ISTANBUL — Shots were fired from a moving car at the U.S. Embassy in Turkey before dawn Monday, an attack that came during heightened tensions between the two NATO allies. Officials said two people with criminal records were detained.

There were no casualties in the fleeting attack, in which three of the six bullets fired hit the embassy gate and a reinforced window in the building in Ankara.

"We can confirm a security incident took place at the U.S. Embassy early this morning. We have no reports of any injuries and we are investigating," embassy spokesman David Gainer said. He thanked Turkish police for their "rapid response."

Ankara governor's office named the suspects as Ahmet Celikten, 39, and Osman Gundas, 38, saying they had confessed. They were apprehended along with a 9-millimeter gun and a vehicle with Ankara license plates.

The statement said Celikten had escaped prison and Gundas had several crimes under his belt, including car theft, drugs, threats and injury.

Turkish officials are locked in a trade and diplomatic dispute with the United States but they fully condemned the shooting in Ankara. Presidential spokesman Ibrahim Kalin tweeted that it was "an attempt to create chaos."

A top official in Turkey's ruling Justice and Development Party said the attack was a "clear provocation" and that foreign diplomats are guests of the country.

"The utmost sensitivity will be shown to ensure their security," said the party spokesman, Omer Celik. "Turkey is a safe country."

The governor's office said they were investigating the suspects' links.

A security guard stands outside the entrance to the U.S. Embassy in Ankara, Turkey, Monday, Aug. 20, 2018. Shots were fired at a security booth outside the embassy in Turkey's capital early Monday, but U.S. officials said no one was hurt. (Burhan Ozbilici/AP)
A security guard stands outside the entrance to the U.S. Embassy in Ankara, Turkey, Monday, Aug. 20, 2018. Shots were fired at a security booth outside the embassy in Turkey's capital early Monday, but U.S. officials said no one was hurt. (Burhan Ozbilici/AP)

The U.S. Embassy was planning to close at midday Monday anyway until the end of the week for the Islamic holiday of Eid al-Adha.

Tensions between the U.S. and Turkey are high, partly because of the case of Andrew Brunson, an American pastor who is being prosecuted in Turkey for alleged espionage and terrorism-related offenses. He denies any wrongdoing and U.S. President Donald Trump has called for his immediate release.

Turkey has long criticized the United States for not agreeing to hand over Fethullah Gulen, a Muslim cleric accused by Turkish authorities of engineering an attempted coup in 2016. Gulen denies those allegations. Washington has told Turkey it must present convincing evidence for any extradition proceeding to go forward.