More than 160 people are dead, 1,440 are wounded and some 2,800 soldiers are under arrest, says Mr Yildirim It follows reports of explosions and gunfire in Ankara and Istanbul overnight as the coup unfolded
Turkey PM Binali Yildirim says coup attempt by faction of armed forces is over In a televised address, he says it was a "black stain for democracy" and plotters "face justice they deserve". President Erdogan made a televised address, urging opposition to the uprising and calling it "treason" Mass arrests started after failed Turkey coup.
The following is as Jeremy Bowen, BBC Middle East editor describes reasons for the coup
The attempted coup happened because Turkey is deeply divided over President Erdogan's project to transform the country and because of the contagion of violence from the war in Syria.
President Erdogan and his AK party have become experts at winning elections, but there have always been doubts about his long-term commitment to democracy. He is a political Islamist who has rejected modern Turkey's secular heritage.
Mr Erdogan has been increasingly authoritarian - and assuming the coup attempt is crushed might become more so. He is trying to turn himself into a strong executive president.
From the beginning Mr Erdogan's government has been deeply involved in the war in Syria, backing Islamist opposition to President Assad - but violence has spread across the border, helping to reignite the fight with the Kurdish PKK - and making Turkey into a target for the jihadists who call themselves Islamic State.
That has caused a lot of disquiet. Turkey has faced increasing turmoil - and the attempt to overthrow President Erdogan will not be the last of it.