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.

A civilian beats a soldier after troops involved in the coup surrendered on the Bosphorus Bridge in Istanbul. [Murad Sezer/Reuters]

Policemen protect a soldier from the mob on the Bosphorus Bridge in Istanbul. [Murad Sezer/Reuters]

Soldiers push each other to board a bus to escape the mob after troops involved in the coup surrendered on the Bosphorus Bridge. [Murad Sezer/Reuters]

A civilian beats a soldier after troops involved in the coup surrendered on the Bosphorus Bridge. [Murad Sezer/Reuters]

A soldier protects himself from the mob on the Bosphorus Bridge. [Murad Sezer/Reuters]
People take selfies after soldiers involved in the coup surrendered on the Bosphorus Bridge. [Yagiz Karahan/Reuters]

Policemen protect a soldier from the mob after troops involved in the coup surrendered on the Bosphorus Bridge in Istanbul, Turkey July 16, 2016. REUTERS/Murad Sezer [Reuters]

Policemen fire into the air to disperse the mob after soldiers are attacked on Bosphorus Bridge. [Murad SezerlReuters]

Soldiers are hit with a stick as they push each other to board a bus to escape the mob on the Bosphorus Bridge. [Murad Sezer/Reuters]
A man takes a selfie on the Bosphorus Bridge. [Murad Sezer /Reuters]

Source: Al Jazeera and agencies