Groups of civilians attacked surrendering troops who took part in a failed coup attempt in Turkey, punching and kicking soldiers who needed protection by armed police.

As residents of the capital Ankara and the country's biggest city Istanbul woke on Saturday morning to news that the coup attempt had failed, relief turned to anger at the troops who had brought tanks on to the streets in a bid to take power.

In Istanbul, troops who had deployed with several tanks on the Bosphorus Bridge on Friday night were attacked by a large and angry crowd on Saturday morning after handing over their weapons.

Police were forced to intervene and some shot into the air to protect the surrendering soldiers from crowds of angry men who rained down punches, kicks, and blows from sticks as alleged coup plotters were herded on to police buses.

Turkey's President Recep Tayyip Erdogan called on his supporters to take to the streets late on Friday to defy the military faction that was trying to depose him.

Images of chaotic scenes were also shared on social media of troops being disarmed by police at the offices of the CNN Turk television channel and being attacked by what appeared to be the station's staff.

The army's Acting Chief of Staff Umit Dundar told a news conference that 104 coup plotters had been killed. He said that 90 others had also been killed, adding that 47 of them were civilians.