It has been a rough week. The world had barely recovered from Thursday’s attack in Nice, France, and the escalating violence in Kashmir and South Sudan when news of a coup in Turkey started doing the rounds on social media on Friday. Details were sparse and sporadic, as army personnel reportedly took TV channels such as CNN Turk and TRT off-air. There were reports of Istanbul’s main airport being closed and gunshots and explosions being heard in Istanbul and the capital, Ankara. Istanbul’s Bosphorus Bridge was also reportedly blocked by a group of soldiers and military vehicles, local outlets reported. While people were still trying to make sense of the events, President Recep Tayyip Erdogan spoke to a Turkish broadcaster via Face Time from his holiday in the resort of Marmaris and urged people to resist the attempted coup. “It is carried out without my knowledge and it is completely illegal,” he said. “I am inviting everyone to go outside and resist against this illegal structure.” Soon after, accounts of clashes between Erdogan’s supporters and army officials in Gaziantep and Istanbul began to emerge on social media. Erdoğan, who returned to Istanbul early Saturday morning said the attempted coup was “treason” undertaken by “a minority within our armed forces” and vowed to use it as an opportunity to “clean up” the army. Prime Minister Binali Yildirim also said the government remains in control and those who attempted the coup were being arrested. The whereabouts of the military chief of staff remains unknown. Flights at Istanbul’s Ataturk airport were resumed and the channels taken off air also recommenced transmission but the overall situation remains tense. Forty-two people died during overnight clashes Ankara, most of which were civilians, the prosecutor’s office said. There were also reports of attacks on the parliament building in Ankara, where Yildirim called an emergency meeting on Saturday.

Historically, Turkey is no stranger to coups. Since the country was founded in 1923, the military has staged coups in 1960, 1971 and 1980, and intervened in 1997. For a while it appeared that the country’s tug of war between civilian and armed forces, which has traditionally seen itself as a custodian of the country’s secular heritage coined by Kemal Atatürk, was a thing of the past. But the country has been embroiled in turmoil over the past few years. Multiple terrorist attacks in the recent past deeply impacted the country’s tourism sector. The currency has also taken a hit and public debt has soared. President Erdogan’s attempts to control the press, imprison his opponents and attempts to clamp down the country’s secular spirit have made him widely unpopular among the people. It remains to be seen if the unsuccessful coup attempt ends up boosting Erdogan’s popularity as the guardian of democratic interests or becomes a turning point for the country’s political apparatus.

Note: This is a developing story and was last updated at 12:00 a.m. EDT.