The attempted coup d'etat by a faction of Turkey's armed forces on Friday failed for many reasons, including divisions among the military and repeated missteps by the plotters.
Social media and mobile communications also played an important role. And it wasn't the first time this combination has enabled citizens to express their will and have a say in deciding who governs them and why.
Judging from available information, the rebellious faction of mid-level army officers sought to implement the classic playbook for military takeovers - what in the old days would have been labeled a "colonels' coup," as opposed to one led by generals. They closed key transportation routes, tried to secure both parliament and the presidential offices, and attempted to capture high-ranking officials, including President Recep Tayyip Erdogan and top military brass. They also took over state media outlets, and used state television to broadcast their message and prematurely declare victory.
Turkey's continental divide
The instigators soon realised that this classic approach was not sufficient, and moved to take control of private television channels, even shutting down the Turkish affiliate of CNN, an event that was broadcast live around the world.
The objective was conventional: By denying citizens access to alternative sources of news, the rebels would be able to control the narrative, dictating the information that was going out and its interpretation. They would also use this control to energise their small group of collaborators and attempt to persuade others to join them, particularly other factions of the military.
But the putschists failed to sufficiently update the standard coup playbook to take into account the realities of social media and mobile technology. As a result, their attempt to control the information available to ordinary citizens was only partial and the military's message was soon drowned out by domestic and international news outlets with much greater powers of amplification. Then, the advantage the military had initially gained through the element of surprise quickly eroded.
Within hours of the beginning of the coup, Erdogan used the video capability on his mobile phone to communicate with the nation, urging Turks to take to the streets and stand up to the rebels. His message was amplified on social media channels, such as Facebook and Twitter, and supplemented by images of people standing in front of tanks and on top of them.
Social media also played a critical role in relaying - in real time - domestic and international support for the president and for Turkey's democratically and legitimately elected government. These messages came from some of Erdogan's internal political critics, too, who used Twitter to condemn the attempted coup, which they said wouldn't bring the right kind of change.
Foreign leaders, including President Barack Obama, echoed the support for Turkish democracy and for Erdogan.
The international and domestic engagement did more than simply feed the curiosity of ordinary Turkish citizens. It countered the certainty about the outcome that the small group of officers in control of state media and some key installations had tried to convey. It also undermined the coup plotters' attempts to convey a state of siege. The flow of information encouraged, empowered and mobilised Turks to confront the rebels and their tanks.
The population went from being passive recipients to proactive participants in the country's present and future. And by challenging the information being transmitted by the captured media sources, they prevented the small group of mid-level officers from turning pre-emptive claims of victory into reality.
A significant number of Turks collectively formed what advancing military forces fear most - crowds of civilians blocking their path and complicating their operational plans. The strength of the people was transmitted both domestically and internationally through images on social media of civilians standing up to rebel soldiers in the streets. This signaled that the rebels were not winning, and diminished the chances that they would ultimately prevail.
Sensing defeat, hundreds of rebellious soldiers started surrendering and road blockades were lifted. The images that filled social media showed that citizens had again found a way to have a deterministic role in their political destiny - particularly when it comes to how they are governed and by whom.
This is not the first time that social media and mobility played an important role in influencing outcomes, or allowed ordinary citizens to play a greater part in ensuring that a tiny minority is unable to impose its will on the majority. And it is not the first time that the will of the people prevailed with the help of technology. For example, in 2011 and 2013, millions of ordinary Egyptians, enabled by social media, stunned the world with their collective action, taking to the streets to influence how they would be governed.
In helping to foil a coup against a legitimately elected government, social media reinforced democracy. This is the flip side of the tragic use of this same technology to influence and radicalise the disenfranchised.
History will record that the rogue Turkish officers and their followers failed to understand how social media has changed the traditional dynamics of military coup d'etats.
It contributed to avoiding an outcome that, at a minimum, would have created huge uncertainty in one of the largest European countries and a member of NATO. That would have been yet another development that "expert opinion," both in the public and private sectors, had not predicted. Now the challenge for Turkey is to ensure that the legacy of the failed coup will be the strengthening of the country's democracy and its legitimate institutions.