It is now almost two weeks since the failed coup in Turkey that began on the evening of July 15 and ended the next morning. A good deal of information and analysis has emerged since then in the public domain, which might help us to understand better what happened during that fateful night. Of course, the picture is still not entirely clear; much remains unknown about the event, except that it could lead to tectonic shifts in geopolitical alignments.

What one can do is to glean relevant information from various sources and try to piece together a picture of the events which makes the most sense, as of now.

First, who were the coup plotters (CPs)? Were they Kemalists or Gulenists? Most likely, they were predominantly Gulenist, as alleged by President Erdogan. Kemalists have been regularly and systematically purged from the Turkish military since Erdogan came to power in 2003. Some of these purges were based on false allegations and evidence; the Erdogan regime is not known for truthfulness and integrity. By 2012 the Kemalists, defenders of Ataturk’s legacy, had been effectively demoralised and purged.

The Gulenists, on the other hand, continued to be on good terms with Erdogan until the end of 2013, when they fell out with him. By that time they had permeated all sections of the Turkish system including the military, police, judiciary, media and academia. During Erdogan’s rule, while the Kemalists were on the decline, the Gulenists were on the rise. Moreover, the Gulenists enjoyed the backing of the CIA and continue to do so.

Second, it appears that Erdogan had been tipped off a few hours in advance about the coup attempt by his own intelligence or the Russians, but decided to let it go ahead. He was therefore always a few steps ahead the CPs. Shortly before his hotel in Marmaris was bombed he took off in his Gulfstream jet. To avoid detection, the jet was using the call sign THY 8456, to disguise it as a Turkish Airlines flight. It was also being escorted by two loyalist F-16s. Erdogan later declared that the attempted coup was “a gift from God,” to help him cleanse the system of Gulenists.

Third, three of the five regiments that were involved in the attempted coup belonged to NATO’s Rapid Deployable Corps (NRDC). It has also come to light that some of the CPs—mostly Colonels and Majors— coordinating the deployment of troops in Istanbul had set up a WhatsApp group on the evening of July 15 to communicate with each other. The transcript of this group’s communications is now available. The group called itself “Peace at home, peace in the world,” which also happens to be the motto of the NRDC.

Fourth, the tanker aircraft which refueled the rebel F-16 jets that flew very low, at rooftop altitude, over Ankara during the opening hours of the coup reportedly took off from the Incirlik air base, where about 2000 US military personnel are deployed. Incirlik also houses NATO’s largest nuclear weapons storage facility—around 50 B-61 hydrogen bombs are stored in its underground vaults. The Turkish General commanding Incirlik, Gen. Bekir Ercan Van and nine other Turkish officers were arrested on July 17 by the Turkish authorities for alleged complicity in the coup attempt.

Several analysts view the above facts as evidence of a direct link between the CPs and the US, and also possibly NATO. They cite them to argue that Incirlik and the NRDC were directly involved in the attempted coup, which means that the US would have known about it.

Turkey’s reaction was strong—it cut off electricity to the base for one week, and grounded all US fighter aircraft for 24 hours. The Turks also believe Incirlik was one of the venues where the coup was plotted.

Fifth, the reaction of the US and the EU to the coup attempt was also seen as suspicious by Turkey. Instead of outright condemnation, they called for “restraint” and “observing the rule of law.” In contrast, Russia and Iran’s response was seen as more sympathetic. Putin phoned Erdogan the next day and Iran promptly condemned the coup. Moreover, EU President Jean-Claude Juncker lectured Turkey on human rights and said it would not be able to obtain EU membership if it did not observe the rule of law. This caused further consternation in Ankara.

Sixth, Al Jazeera has reported, quoting two Turkish officials, that the faction in the Turkish army that attempted the coup was “under investigation,” and most likely acted hastily out of growing fear that arrest of some officers was imminent. This could explain the sloppy manner in which the coup was executed.

But it seems clear that the coup had been in the making for quite some time, and while the main actors were from the army, a section of the Turkish air force was also involved.

In view of the above, Turkish allegations that the US and Gulenists were behind the failed coup cannot be easily dismissed. Turkish statements alleging their complicity and demanding Gulen’s extradition are becoming more strident by the day, resulting in steady deterioration of her relations with the US and the EU.

Turkey is also hinting that a major reassessment of its foreign policy may be on the cards, wherein it might turn more to the East than West. It has finally understood that it is never going to get EU membership, whatever it might do to meet "EU benchmarks." Ataturk believed that if Turkey broke completely with its Islamic heritage and adopted European norms and culture, it might be one day be accepted as a member of Europe.

That was a fundamentally flawed belief for two reasons. First, Kemalism was imposed by a small, urban elite—military and intellectual—on a traditional and mostly rural society, which never fully accepted or practiced it. It was a painful process of top-down cultural revolution. For several decades the Turkish Army enforced Kemalism at gunpoint, at the cost of democracy. But it could not do so once genuine democracy struck roots in Turkey, and the people made clear their support for Islamism, albeit moderate.

Second, Kemalism was competing with 1400—or at least 1000— years of Islam. And the break that Ataturk made was very drastic—changing the script of the Turkish language, the traditional dress code, giving up Islamic religious practices such as fasting during Ramadan, drinking alcohol, etc. It was perhaps naive to think that deeply rooted religious and cultural practices could be abolished by a mere decree. In the long run, Kemalism just could not have competed with Islam. What is now happening in Turkey, therefore, should not come as a surprise. It was bound to happen, sooner or later. Kemalism, as it has been known so far, may be dead.

It would therefore not be surprising if, as a result of its reassessment, Turkey decides to develop closer relations with Russia, Iran, Central Asia, Caucasus, East Asia and China. Being a crucial “swing” state, Turkey’s eastward turn could have significant geopolitical consequences, including some adverse implications for the West. The US and EU can, therefore, be expected do their best to keep Turkey in the Western orbit, as its loss would be a major disaster for them. Another attempt at externally-sponsored regime change would not be surprising.

But outsiders cannot be blamed for all of Turkey’s problems, many of which are the result of Erdogan’s policies. His biggest mistake was causing extreme polarization in the society, by his authoritarian ways and his quest for absolute power. Since 2003, he has sought to silence all opposition and criticism by muzzling the press and using the police and the judiciary to jail his opponents, often on trumped-up charges. There were major scandals in 2007 and 2010, later found to be fabricated, which resulted in the incarceration of hundreds of senior military officers, journalists, and others.

Erdogan’s Syria policy is also responsible for many of the problems Turkey is facing today. He was an enthusiastic participant in the regime change campaign launched against President Assad in March 2011 by the West, Israel, and Gulf. Turkey’s role was one of the most crucial, as it was the conduit through which the mercenaries and weapons were channeled into Syria.

But the blowback from Syria was devastating and destabilized Turkey itself. Today, there are around three million Syrian refugees on Turkish soil and ISIS has struck roots in the country. Erdogan’s meddling in Syria was not supported by the Turkish army and the people, but he went ahead nevertheless, at the behest of his Western allies.

One positive outcome of the failed coup could be a change in Turkey’s Syria policy, which could help bring peace to the country. But that would require a change in the policies of the other major players also, particularly the US and Israel, which is not clear, especially if Hillary Clinton comes to power.

Erdogan also presided over the renewal of the conflict with the Turkish Kurds in the summer of 2015, resulting in large casualties on both sides. At the same time, Turkish forces have also attacked the Syrian Kurds in northern Syria, who have fought ferociously against ISIS in the country. Erdogan does not want to see a Kurdish state, or even an autonomous region, in Syria, which he suspects the US of engineering. This is one of the levers the US could use against Turkey in the future.

Erdogan’s ongoing campaign against the July 15 coup plotters is assuming massive proportions. As of now, more than 60,000 people have been arrested, dismissed or suspended from their jobs in Turkey. They belong to all segments of the society—military, police, judiciary, media, academia, and the civil service. Turkey today has more journalists in jail than China and Iran combined. And this campaign comes after the major anti-Gulen purge in 2014, which followed the Presidential elections in August 2014.

The state of Emergency announced by Erdogan on July 20 for three months is likely to traumatize further and polarize the Turkish people, and exacerbate the fault lines in the society. It will also be unhelpful for the economy, which is in a bad shape. Tourism, which is one of the main sources of income and employment, is likely to suffer losses.

Economic hardship often fosters internal instability and discontent. It is not clear if Erdogan’s popularity will continue to be high under these conditions, and how long he can stay in power. He can also no longer count on the West for help. Turkey— and Erdogan— seem to be in for some difficult times.