The Ankara governor's office said in a statement it had taken "extra security measures" after usa sources provided Turkish intelligence with information on the possibility of terror attacks against the embassy and where Americans lived. It was not immediately clear whether the arrests were connected to the closure of the embassy.
The US embassy in Ankara will be shut down starting Tuesday due to a security threat, it said in a statement.
Starting March 5, the Embassy will provide "only emergency services", the Monday announcement said.
Their competing policies in war-ridden Syria such as Washington's continued aid for Kurdish forces fighting IS, and Ankara's ongoing invasion of the besieged enclave of Afrin in Syrian Kurdistan as well as the Turkish leadership's realignment with Russian Federation has added to the strained relations.
The Anadolu news agency said police detained four suspects on March 5 - all of them Iraqi nationals.
Several digital documents were seized in the operation, the agency reported.
While relations between the United States and Turkey - both North Atlantic Treaty Organisation allies and members of the coalition against Islamic State - have been strained in recent months, Turkey said the embassy closure was not political.
The suspects detained on charges of plotting an attack against the U.S. Embassy in Ankara were taken to the police station for formal legal proceedings. Two others were detained in Samsun. The 12 were among 20 people in the case, for whom arrest warrants were issued by the state prosecutor's office, the report said. They were allegedly trying to recruit members for the Islamic State group and were in contact with people in "conflict zones", the statement said.
The embassy was the target in 2013 of a suicide bombing claimed by a far-left group that killed a Turkish security guard. Turkish troops and proxy forces are attacking the US-supported Kurdish militias, which the Turkish government considers a security threat. A lone gunman killed 39 people at an Istanbul nightclub during New Year's Eve celebrations.