"An individual approached the US Embassy Ankara main gate and discharged a firearm," the embassy said in a statement, adding no-one was hurt and the individual was detained.
As a result, the embassy and consulates in Istanbul and Adana were closed for normal operations, it added.
The incident took place at 3:50 AM (0620 IST) today, hours after a Turkish policeman shot dead Russian ambassador Andrei Karlov as he was opening a photography exhibition.
The United States has repeatedly warned its citizens of security risks in Turkey after a string of attacks blamed on Kurdish militants and jihadists this year.
"The US Mission reminds US citizens to review personal security plans" and to "maintain a high level of vigilance and take appropriate steps to enhance your personal security," it said.