(CNN)There was chaos in the streets of Turkey's major cities early Saturday as thousands of pro-government demonstrators protested an ongoing coup involving units of the country's military.
The military claimed to have seized power from the government led by President Recep Tayyip Erdogan, but he and other officials said the officers involved would be punished.
Erdogan urged citizens to take to the squares of the capital of Ankara and Istanbul. Many protesters descended on the areas where military vehicles were positioned, including two bridges leading from the European side of Istanbul to the Asian side. Some soldiers were greeted by people who jumped on their tanks, but others got hugs from apparent supporters.
A Turkish fighter jet shot down a helicopter that had been commandeered by "coup plotters," a Turkish presidential source told CNN.
There were reports of gunfire, according to Turkish broadcaster IHA and the U.S. Embassy in Ankara.
The Turkish military claim was read by an anchor on state broadcaster TRT. She said the military has taken over and imposed martial law.
The statement was made on behalf of the "Peace in the Nation" council, the announcer said. "The political administration that has lost all legitimacy has been forced to withdraw," the anchor said.
"Go to the streets and give them their answer," he told residents during a Facetime interview on CNN Turk.
"I am coming to a square in Ankara. ... This was done from outside the chain of command," Erdogan said of the military. "Those who are responsible, we will give them the necessary punishment," he said. It was not clear from where he was speaking.
Earlier, Prime Minister Binali Yildirim vowed the coup attempt would not succeed.
He told state news agency Anadolu the coup is "an attempt against democracy and the will of the people. Those who attempted this will pay the heaviest price."
There have been no independent verification of the claims by the military or the government. It is unclear who is in charge in Turkey. A curfew has been imposed in the country by the military.
The military has issued statements, which have been published in some Turkish media, and not others, and reported by the Reuters news agency, claiming it has "fully seized control of Turkey" to maintain democratic order, that rule of law must remain a priority and international relations must remain. The statements have not been distributed through regular web channels.
A CNN producer said there were 200 to 300 residents in Taksim Square in Istanbul. Some of them were waving Turkish flags. About 100 police officers were shooting off tear gas, trying to disperse the crowd.
At least one army tank and one other military vehicle were at the square.
Shots have been fired and explosions have been heard in Ankara as the coup continues, according to the U.S. Embassy in Ankara.
All flights at Istanbul Ataturk Airport have been suspended and Americans are urged to stay where they are.
The U.S. Embassy said in a statement: "We urge U.S. citizens to contact family and friends to let them know you are safe. We have seen reports that social media is blocked ... We encourage U.S. citizens to shelter in place and do not go the U.S. Embassy or Consulates at this time."
U.S. Secretary of State John Kerry told reporters in Moscow that he has been given reports about what is going on. "I don't have any details. I hope there will be peace, stability and continuity in Turkey," he said.
A report from the U.S. Embassy in Ankara said military-appearing jets had been flying low over the city and Istanbul for about an hour.
One tweet showed a military jet flying extremely low over the capital Ankara.
Two bridges in Istanbul are closed in one direction by the military. Cars are flowing from the European side of the city to the Asian, but soldiers and military vehicles are blocking the path to the European side.
Erdogan is the co-founder of Turkey's ruling Justice and Development Party (AKP). He was elected Prime Minister in 2003. Under his rule, Turkey became a powerhouse in the Middle East. His reign came to an end in 2014, and his own party's rules prevented him from seeking a fourth term.
So, he ran for president -- and won. Before this, the president of Turkey was a largely ceremonial role, but Erdogan tried to change that by altering the constitution to give him more power.
The 2015 election resulted in a hung Parliament, leading to sweeping anti-government protests and terror attacks. Turkey held a snap election, and with that, Erdogan's AK Party regained control.
Under Erdogan, who is extremely conservative, religion had started to play a more important role in Turkey, which is a largely secular country. He was active in Islamist circles in the 1970s and 1980s.
Erdogan is open about his dislike of social media. Sites such as YouTube and Facebook are frequently blacked out in the country.