“I am calling on our nation. Go to squares, let us give them the best answer,” Erdogan said in a video message from a cell phone that was broadcast on a cell phone connection from what appeared to be a private residence. “I do not believe this coup attempt will be successful. No coup-plotter in history has ever succeeded,” he said.

Erdogan said there had not been any attempt against him and the Turkish presidency has said the president is at a secure location.

Prime Minister Binali Yildirim announced a no-fly zone has been enforced above Ankara, adding that army commanders, including Chief of Staff Hulusi Akar, are on duty and at work to stop the illegal military action.

Yildirim said there was “no doubt coup-plotters would fail”, calling on them to “return from their mistake” and describing the attempt as “idiotic” and “craziness”.

Bombs struck near the Turkish Grand Assembly, witnesses said, injuring 12 people, two of whom are in critical condition. There are reports of airborne shelling at several locations in the capital, including the ruling AK Party headquarters, the presidential complex, and the General Staff.

MPs have converged on the Assembly and gathered under the statement “Sovereignty unconditionally belongs to the Nation” inscribed on the wall of the main session hall. They have reportedly moved to the bomb shelter of the complex after the airstrikes.

A Turkish army F-16 reportedly shot down a Sikorsky helicopter, and aircraft belonging to army continue to fly over the capital to repel any attacks on key buildings.

Meanwhile, reports of casualties have emerged. Seventeen police officers were killed in an airstrike by a helicopter controlled by coup-plotters on a police station in Golbasi, 20 kilometers (12 miles) from the capital of Ankara, the governor's office said.

Two workers at satellite communications agency Turksat's ground station in Golbasi were killed while trying to prevent coup-plotters from cutting off TV networks, Anadolu Agency reporters on site reported.

Another two civilian deaths were reported in Istanbul, where an attempt to take over the governor’s office has been repelled, Governor Vasip Sahin said, with many soldiers detained across the city.

All across Turkey, citizens have responded to the president's call by pouring into the streets, as shown on numerous videos and photos on social media.

One video from an unknown location showed citizens climbing on top of a tank, hoisting soldiers out of the vehicles and securing their weapons. Another showed a police station with soldiers placed under arrest.

The majority of media organizations meanwhile have continued to broadcast live despite attempts to silence them.

The soldier arrests come on the heels of Ankara Chief Prosecutor's Office opening an investigation into the coup and calling for soldiers' detention “wherever they are spotted”.

First Army commander Umit Dundar has said coup leaders represent a small minority in First Army command. “There is nothing to worry about. We are taking necessary measures with the soldiers who have not joined them and are still acting within chain of command.”

“We are in control of the situation,” Zekai Aksakallı, Special Forces Commander said.

Third Army Commander Erdal Ozturk while on live television ordered his units to “return to their barracks”.

The coup attempt has effectively been repelled, Turkish National Intelligence Agency Nuh Yilmaz has said.

Erdogan identified the group as belonging to the FETO/PDY terrorist organization, which three years ago staged an unsuccessful overthrow of the government.

“This is an insurgency against democracy and national will,” Prime Minister Binali Yildirim told the nation on live TV late Friday. “We will not allow it. There will never be any compromise on democracy. The perpetrators will pay the heaviest price.”

State-run broadcaster TRT, where coup-plotters forced an anchorwoman to read a “military has taken over” statement on air, has been freed and five soldiers have been arrested.

Turkish labor minister entered TRT headquarters in Ankara with citizens accompanying him.

“We will understand who they are and their purpose soon and will do what is needed. Our nation should keep calm. We will never tolerate such illegal activities that interrupt democracy,” according to Yildirim.

Soldiers were seen earlier blocking both bridges in Istanbul, and tanks were stationed outside the International Ataturk Airport.

The prime minister said police would “retaliate” and that “what is necessary will be done even if it requires death”.

Leader of opposition Nationalist Movement Party Devlet Bahceli has called the prime minister to express solidarity, calling the coup attempt unacceptable, ministry sources said.

Main opposition Republican People's Party (CHP) leader Kilicdaroglu said: "This country was wracked with coups. We do not want to go through the same troubles." 

Anadolu Agency