Instead the coupists fired on the Parliament with tanks- not sure what the point of that was. They managed to kill about a hundred civilians, and it's reported by the regime that 105 coup troops were killed, and 1,500 taken into captivity. It's claimed that police units were able to defeat units of the coup attempt. A coup helicopter was shot down, and one flew to Greece with officers of the coup seeking asylum. (Greece and Turkey have a hostile relationship, for historical and contemporary reasons, the contemporary ones centering around the Turkish invasion of Cyprus. Both are members of the U.S.-bossed military alliance, NATO, making them uncomfortable bedfellows at the same time.)
Erdoğan called on his followers to turn out in the streets and confront the coup elements, requiring them to defy coupist instructions to the population to stay indoors. Apparently thousands heeded Erdoğan's call, complicating matters for the coup side.
Erdoğan, true to his temperament, vowed that the "traitors" would "pay a heavy price." (Mass executions, anyone?)
Torture of prisoners has long been routine in Turkey, both in political and non-political cases.
Military coups have been common in Turkey since World War II. They are generally done in the name of protecting the secular nature of the Turkish Republic. 
Erdoğan, an Islamist who leads an Islamist party, and whose base is the religiously-oriented segment of the populace, a segment that has been growing both in numbers and in religious conservatism in Turkey, has been gradually eroding that secular aspect of the Turkish state. His rise to power represented in part the liberation of the religious from the suppression they suffered under the Ataturk legacy.
So the handy defeat of this coup may well spell the end of secular power in Turkey.
The so-called "Western democracies" all rushed to back Erdoğan, predictably, since they want to stay in his good graces for their own reasons (and they have sensitive power-sensing antennae, so they could detect which way the wind was blowing on his coup attempt). The Europeans have a deal with the regime for Turkey to act as a garbage bag for unwanted refugees from Syria and elsewhere. The U.S. is running military air operations out of Incirlik air base in Turkey. 
Which brings me to a second big mistake of the coup plotters. They didn't clear their plot with the U.S. first.
1] The contemporary state of Turkey was founded on secularist principles by Mustafa Kemal Atatürk, a revolutionary army officer, and first president of the new nation he is credited with founding, the Republic of Turkey, (the core of the Turkish Ottoman Empire). After the defeat of the Ottoman Empire in World War I (1914-18, during which time the Turks conducted the Armenian genocide under cover of war), Ataturk led a successful war against the Allies from 1919-22 to create the new Turkish nation. The name "Ataturk" was bestowed on him by Parliament in 1934 and means "Father of the Turks." By law no other Turk may use the name.
Ataturk abolished the Caliphate and sharia courts in 1924. A failed assassination plot against him in 1926 provided him an opportunity to hang various political opponents.
2] U.S. Secretaryt of State John "Skull and Bones" Kerry issued noises supporting Erdoğan, German Chancellor Angela "The Iron Mouse" Merkel did likewise, and newly-anointed British Foreign Secretary Boris "BoJo" Johnson called the Turkish Foreign Minister to give him a verbal pat on the back.