Turkey on Monday launched a crackdown on the Islamic State extremist group and boosted security in Ankara after the US embassy said it would be closed for a day.
The Ankara prosecutor said 12 suspects had been detained after it issued 20 arrest warrants as part of an operation against IS, state news agency Anadolu reported.
Those detained were foreigners who were trying to recruit members for IS, Anadolu reported, adding that the suspects were in contact with those in "conflict zones".
IS has lost control of swathes of Iraq and Syria after US-led military operations but it still holds sway over small pockets in Syria.
The embassy said it would be closed on Monday because of a "security threat", without giving further details.
The Ankara governor's office said in a statement it had taken "extra security measures" after US sources provided Turkish intelligence with information on the possibility of terror attacks against the embassy and where Americans lived.
The US embassy is in the heart of the capital, close to parliament.
On its website, the mission urged Americans to "avoid large crowds" and "keep a low profile".
The embassy was the target in 2013 of a suicide bombing claimed by a far-left group that killed a Turkish security guard.
Turkey suffered multiple terror attacks in 2015 and 2016 as well as one in 2017 blamed on IS and outlawed Kurdish militants. Hundreds of people have died.
The last attack which IS claimed was just 17 minutes into 2017 when a gunman killed 39 people at the elite Istanbul nightclub Reina during New Year's celebrations.
Turkish police often carry out raids against IS across the country including one last month when 29 foreigners were detained in Istanbul over alleged links to the group.
Ties between Turkey and the US have been strained over multiple issues, including Washington's support for the Syrian Kurdish People's Protection Units (YPG) militia, which Ankara considers a terrorist group.
Ankara in January launched an operation against the YPG in the Syrian border region of Afrin, but the US has called on Turkey to show restraint in the offensive.