The pinnacle of Turkish Prime Minister Recep Tayyip Erdogan's prestige might be pinpointed to his visit to Cairo in September 2011.
Europe was mired in economic crisis and the Middle East was rocked by popular uprisings. But Turkey – wedged in between – was basking in a golden decade of growth and stability.
Mr. Erdogan's Justice and Development Party (AKP) had recently been reelected with a shade under 50 percent of the vote. That same year, Turkey's gross domestic product expanded 8.5 percent, a growth rate second only to China's. The following January, President Obama would say that Erdogan was one of the five world leaders he most trusted.
The Turkish leader was seen as having combined political Islam and democracy in a country with a complex ethnic, religious, and social mix – with stellar results. After receiving a rock star's welcome in Cairo – where the Muslim Brotherhood would soon embark on its own political venture – he used a television interview to promote the so-called Turkish Model.
"The Turkish state is in its core a state of freedoms and secularism.... Why should the Europeans and Americans be the only ones that live with dignity? Aren't Egyptians and Somalians also entitled to a life of dignity?"
Fast-forward 2-1/2 years, and the mood has changed radically. Social media platforms have been banned. New laws have eroded legal checks and balances, and antigovernment protests have been met with a harsh police crackdown.
As Erdogan spews fiery rhetoric against "terrorists" and "traitors" and denounces plots by Western enemies, to many observers he more closely resembles the Arab autocrats whose ouster he celebrated than he does a democratic hero. The West has lost a leader it thought could provide a bridge to the Middle East.
"The AKP were given the mission to prove that Islam and democracy were compatible," says Yavuz Baydar, a liberal newspaper columnist and former supporter. "They were right to be given that opportunity, but they blew it."
The incremental crackdown
The change was most visible during protests last June to protect a park in central Istanbul. Erdogan strongly backed a security crackdown that left 10 dead and dozens seriously injured. He lauded often heavy-handed police as "heroes."
But it was also evident in December, when, after key allies were arrested as part of a 15-month corruption investigation by police, his government purged thousands of officers and rushed through legal amendments to neuter the judiciary. More recently, he banned social media platforms Twitter and YouTube after leaks of phone conversations alleging further corruption continued to emerge online (the former was unblocked after a ruling by the country’s top court on April 2). Another bill, yet to be passed, would grant sweeping new powers to the domestic intelligence agency.
"Since June particularly, each and every measure and word and step by Erdogan is opening the door wider to autocratic rule," Mr. Baydar says.
Turkey's economy – lauded by international investors – grew in 2013, despite the instability, but it appears headed for a sharp slowdown.
But Erdogan has confounded his opponents at the ballot box. In local elections March 30, the AKP won a big victory by taking 45.5 percent of the votes and retaining the cities of Istanbul and Ankara. Its main rival, the Republican People's Party, trailed by 17 points.
He secured that victory by aggressively demonizing his opponents and portraying himself and, by extension Turkey, as under assault by foreign and domestic enemies. In a victory speech, he warned his opponents that he would "enter their dens.... They will pay for this."
Party of the people
When the AKP swept to power in late 2002, its feet were rooted in political Islam but its gaze seemed firmly set on liberal reforms and European Union membership.
Using a flood of funds from privatization and foreign investment, the AKP built airports, highways, and hospitals. Health-care reforms expanded coverage to 90 percent of the people and allowed ordinary citizens to use the emergency wards of exclusive private hospitals.
"What [Erdogan] did was so formidable," says Henri Barkey, a Turkey specialist at Lehigh University in Pennsylvania. "He gave access to millions of people who really suffered in state hospitals. That in itself has won the loyalty of millions who will never abandon [him] because of it."
As his support grew, the former Islamist – he and the AKP pledged their commitment to the secular system before coming into power – generated unease within the secularist elite.
Its bastion, the military, sees itself as the guardian of the rigidly secular system laid out by Turkey's modern founder, Mustafa Kemal Ataturk, and has toppled four governments since 1960. For decades, more traditional and religiously conservative Turks were marginalized.
Erdogan successfully styled himself as an avatar for their aspirations. A ban preventing women from attending university wearing Islamic head scarves became a touchstone issue.
The first crisis came in 2007, when the military spoke out against the AKP for nominating one of its own – Foreign Minister Abdullah Gul – for the traditionally apolitical role of president, a role at that time appointed by parliament.
Erdogan responded by calling snap elections, which he won with 47 percent of the vote – an undeniable electoral mandate in Turkey's multiparty system. The military had to back off. Emboldened, Erdogan installed Mr. Gul as president and the AKP moved on its adversaries.
Eliminating the opposition
Over the next three years, prosecutors launched two mass trials targeting military officers suspected of plotting against the government, and the AKP pushed reforms that undermined secularists within the judiciary.
"Once those opponents were cleared away, the AKP had power without balancing actors," says Ihsan Dagi, a professor of international relations at the Middle East Technical University in Ankara and another liberal former adherent of the AKP. "Before, the state was always somehow autonomous from government.... In Turkey's recent history we haven't seen this kind of monopolization of power since the 1960s."
Erdogan's key ally in this battle was Fethullah Gülen, a Pennsylvania-based Turkish imam who commands a global network. The Gülenists had risen to high bureaucratic positions in the preceding 25 years, particularly in the police and judiciary, and spearheaded the mass trials that brought down the old secularist cadres.
After the AKP's latest, most resounding electoral victory in 2011, liberal supporters such as Baydar and Mr. Dagi grew uneasy at what appeared to be a swerve toward authoritarianism.
They partly blame the opposition, which has failed to mount a serious challenge. The secularist Republican People's Party, formed by Mr. Ataturk, has not attempted to widen its appeal beyond its core voters, which make up no more than 25 percent of the electorate. "Turkey's greatest disaster has been the ineffectiveness of the opposition," Mr. Barkey says.
But the key ingredient of the AKP's lurch toward authoritarianism is the character of Erdogan himself, most observers agree.
In a leaked diplomatic cable from January 2004, then-US ambassador to Turkey Eric Edelman described Erdogan as harboring "unbridled ambition stemming from the belief God has anointed him to lead Turkey," as well as an "authoritarian loner streak" and "an overweening desire to stay in power."
Erdogan's string of victories has only reinforced these characteristics, many claim.
"When every wall that you encounter crumbles in front of you, after a while you start to think, 'Hey, I must be God," Barkey says.
His rise to power also might have entailed corruption. Mr. Edelman wrote: "Increasing numbers [of] AKPers ... are telling us of conflicts of interest or serious corruption in the party at the national, provincial, and local level and among close family members of ministers."
When Erdogan was Istanbul mayor from 1994 to 1998, the municipality dispensed favors in exchange for donations to the AKP or affiliated charities, Barkey says.
"It's not the kind of corruption you see in Nigeria. It's not about filling pockets for the sake of filling pockets," he says. "It's about creating a patronage network that is completely loyal to Erdogan, and in the process consolidating AKP's hold on society so it will survive no matter what."
According to evidence leaked in January, allegedly from a police investigation, last year Erdogan pressured a group of construction magnates to donate $450 million to buy a media group and ensure it remained in friendly hands. In return they were to be awarded public construction contracts. Erdogan denied the claim.
Colliding with a new Turkey
Some observers see recent mass protests as the result of a collision with the freer, more middle-class Turkey created by Erdogan's early reforms. Angered by his paternal lectures on topics ranging from how many children women should have to what kind of bread people should eat, the predominantly young protesters coined a simple slogan: "Shut up, Tayyip!"
The demonstrations that began in Istanbul on May 31, 2013, were triggered by a project pioneered by Erdogan to build over Gezi Park, one of the city's few remaining green spaces.
"The people taking to the streets in the Gezi protests are people who grew up in the AKP decade. The new generation do not accept that the person at the top has this paternalistic mind-set, thinking that he can decide on everything in Turkey," Dagi says. Erdogan "can't understand the social dynamics he himself unleashed."
But the more serious threat to Erdogan is the corruption investigation launched in December and linked to his ongoing power struggle with Mr. Gülen's movement. With their mutual enemy, the secularist military, largely defanged, their alliance has broken down. The government accuses the Gülenists of launching a massive wiretap operation to blackmail it. Gülen denies this, saying the investigation, which burst into the public domain with the arrest of key Erdogan allies Dec. 17, is merely the result of prosecutors and police doing their job. Erdogan has responded by purging several thousand police officers and scores of prosecutors and judges.
An Erdogan win – for now
By winning the March 30 elections, Erdogan appears to have won the battle for the moment, riding the record of his early successes and popular reforms and portraying his woes as part of a foreign-backed assault on Turkey.
In his victory speech before thousands of cheering supporters, he said the result showed that "the Turkish people are impassable.... We are the owners of this country. The people will not bow and Turkey is invincible."
A greater threat may lurk in the wings, however. Turkey's strong economy, a linchpin of the AKP's success, shows signs of ailing. In a survey conducted last month by Monitor Global Outlook, a global intelligence and research service of The Christian Science Monitor, 10 leading Turkey economists predicted a median growth rate for 2014 of just 2.3 percent, not enough to prevent rising unemployment.
Erdogan is widely expected to run to become Turkey's first directly elected president in August. Another election campaign is only likely to further inflame tensions in the country – in the lead-up to his latest election victory, he accused opponents of being traitors and protesters of being terrorists.
"The more Erdogan says that the 50 percent of the country that didn't vote for him are co-conspirators in a coup, the more that the 50 percent will be forced to question the legitimacy of his rule," says Sinan Ulgen, chairman of the Centre for Economics and Foreign Policy Studies, an Istanbul-based political think tank.
At a rally after last month's funeral for Berkin Elvan, a 15-year-old who died after being hit in the head by a police tear gas canister during protests, Erdogan encouraged Turks to boo the mourning family, who blamed him for the boy's death. Erdogan described Berkin as "a kid with steel marbles in his pockets, a slingshot in his hand, his face covered with a scarf, who had been drawn in by terror organizations."
Berkin's death triggered violence in his neighborhood between rival political groups, recalling for many one of the darkest periods in recent Turkish history: the politically motivated street warfare of the late 1970s, which killed thousands annually. Will Erdogan risk taking Turkey back down that path to save himself?
Barkey says that the AKP will pull back before it comes to that, fearing economic repercussions. But it is unlikely that election victories alone will extricate Erdogan or Turkey from the fix they are currently in.
"I don't see the crisis ending for Erdogan unless he does a very surprising thing and disassociates himself from this kind of rhetoric and realigns himself with the rule of law," says Mr. Ulgen. "Unless he does that – and I don't think he will – the crisis will continue."