Turkey’s president, Recep Tayyip Erdogan, strode onto a stage a month ago looking down upon a sea of a million fans waving red Turkish flags. They were celebrating the 15th-century conquest of Istanbul by the Ottoman sultan Mehmed II, the golden moment of Turkey’s Muslim ancestors triumphing over the Christian West.
“The conquest means going beyond the walls that the West thought were impervious,” Mr. Erdogan said as the crowd roared. “The conquest means a 21-year-old sultan bringing Byzantium to heel.”
The spectacle, complete with a fighter-jet sky show and a re-enactment of the conquest with fireworks and strobe lights, projected an image of unity and command, of a nation marching together toward greatness, drawing on the achievements of a glorious past. But that soaring vision is being grounded by sobering realities.
Mr. Erdogan, who long professed a foreign policy of “zero problems with neighbors,” now seems to be mired in disputes with just about everybody and just about everywhere. Kurdish and Islamic State militants have struck Turkey 14 times in the past year, killing 280 people and sowing new fears. The economy has suffered, too, as the violence frightens away tourists.
At the same time, Mr. Erdogan has become increasingly isolated, frustrating old allies like the United States by refusing for years to take firm measures against the Islamic State. He has recently gotten serious about the militant group, but that appears to have brought new problems: Turkish officials say they believe that the Islamic State was responsible for the suicide attack that killed 44 people on Tuesday in Istanbul’s main airport, a major artery of Turkey’s strained economy.
He has helped reignite war with Kurdish separatists in Turkey’s southeast, and hundreds of civilians have died in the fighting, which began last summer. He alienated Moscow last fall when Turkish forces shot down a fighter jet that he said had strayed into Turkish airspace.
He had grown so alone that this past week he moved to make peace deals with Russia over the jet’s downing and with Israel over its killing of several Turkish activists on a Gaza-bound flotilla in 2010, after railing against both countries to voters.
“I think this is an indicator of how desperate they are,” said Cengiz Candar, a visiting scholar at the Stockholm University Institute for Turkish Studies.
Where Mr. Erdogan once held up Turkey as a model of Muslim democracy, he now frequently attacks democratic institutions. The editor in chief of Turkey’s largest daily has fled the country, and another is on trial on charges of revealing state secrets. The president has grown intolerant of criticism, purging his oldest allies from his inner circle and replacing them with yes men and, in some cases, relatives. (His son-in-law is the energy minister.)
Mr. Erdogan hints darkly in near-daily speeches on Turkish television that foreign powers are plotting to destroy him, and he has moved from a modest house in central Ankara to a grandiose, Persian Gulf-style palace on the edge of the city. Brown and pink buildings for his staff dot meticulously landscaped grounds so enormous that staff members are driven around in minibuses.
Now he has set his sights on a new target: transforming Turkey’s parliamentary system of government into a presidential one, a change his critics say could soon open the door to his seizing the title of president for life. On the night of the airport bombing, the Parliament, which his party controls, worked until 5:45 a.m. to pass sweeping legislation that will help pave the way by purging hundreds of judges from Turkey’s top two courts.
“The ship is going very fast toward the rocks,” said Ergun Ozbudun, a liberal constitutional expert who once defended Mr. Erdogan. “Pray for us.”
The story of how Turkey, a NATO member with the eighth-largest economy in Europe and a population the size of Germany’s, ended up here is as much about Mr. Erdogan as it is about the country’s unlucky geography in a convulsing Middle East. While Mr. Erdogan has seemed to have nine lives, wriggling out of every crisis, he now finds himself cornered by conflicts on many fronts, including deep divisions in his own society that he has helped create.
“Erdogan is still the most popular political leader, but there is unease in the population,” said Soli Ozel, a Turkish columnist and professor at Kadir Has University in Istanbul. “A lot of people are thinking this is an untenable situation.”
Mr. Erdogan, 62, is one of the most talented politicians Turkey has ever known, rising from a poor neighborhood in Istanbul to the heights of power, where he has won election after election since 2002. He succeeded where others had failed in tearing down Turkey’s rigid, classist system of government; sending the meddling military back to its barracks; and opening up the bureaucracy, long deeply suspicious of Turkey’s pious underclass.
In his early years as prime minister, the economy soared and, as incomes rose sharply, so did his popularity. But his critics — and even some of his admirers — say he became so absorbed in battling his enemies, both real and perceived, that he lost his way. He became distracted, they say, by delusions of imperial grandeur and in the process badly damaged institutions critical for a functioning democracy.
Even a former friend, who like others feared being identified, said he had known Mr. Erdogan for 40 years, but no longer recognized him.
Mr. Erdogan’s advisers point out that institutions like the free press and judiciary were never all that free to begin with. They say that his government has genuinely been in danger, a claim Western officials corroborate, and that changes in the judiciary aim to fix a broken system.
Ilnur Cevik, one of Mr. Erdogan’s chief advisers, said the rapprochement with Russia and Israel was part of a strategy to turn the page and might soon be followed by similar measures to quiet some of the storms Mr. Erdogan had raised, like the one with Egypt: Mr. Erdogan had a falling-out with that country in 2013 over the ouster of Egypt’s first democratically elected president.
There was good news on the media front, too: On Thursday night, a journalist and a human rights activist were released from jail.
“We have to kind of change gears regarding foreign policy, regarding the press, regarding many issues in Turkey, and I think Mr. Erdogan will start doing that,” said Mr. Cevik, seated in a spacious palace room recently outfitted, so it smelled like the interior of a new car. “We have to show our true face to the American public. We are completely misunderstood at the moment.”
A political outsider, Mr. Erdogan helped found the Justice and Development Party, a diverse and inclusive grass-roots political machine that turned out to be very good at winning elections, not because it cheated but because its members worked hard.
“He really listened to his friends,” said Dengir Mir Mehmet Firat, another of the party’s founders. “He was patient. He would consult with a rich and varied spectrum of people. When he saw violence, he knew how to step back.”
To gain control of Turkey’s bureaucracy, Mr. Erdogan struck an alliance with an opaque religious group led by a Muslim preacher, Fethullah Gulen, filling the ranks of the police and the judiciary with its highly educated members.
“I told him I didn’t think any part of the state should be left to the control of people with a certain ideology,” said Mr. Firat, a Kurd who has since left the party. “His answer was, ‘We will not be harmed by those who look toward Mecca.’ We were not an Islamist party — we were a democratic party. But he was already drifting away.”
That was because he could: With the military out of the picture, the major check on his power had been removed.
But Islam was not his undoing. Absolute power was. As Mr. Erdogan grew more popular, winning broad pluralities and even majorities in each successive election, he began to behave with a kind of Bolshevism, believing that he was the very embodiment of the people, former officials said.
Others argue that Turkey’s problems are as much about the country as they are about Mr. Erdogan.
“We treat Erdogan as the cause, but in some sense, he is the consequence of Turkish society — he is our creation,” said Hakan Altinay, the director of the European School of Politics at Bogazici University in Istanbul. “We have learned that even though we have the hardware of democracy — institutions, elections — our software is not good. We are too attuned to status, too willing to submit to authority.”
Today, many say Mr. Erdogan has simply adopted the bad habits of former Turkish leaders he came to power to defeat. He needs allies, so he has struck an alliance with the military — the chief of staff was a witness at his daughter’s wedding — and extreme nationalists are now resurgent. That is deeply troubling to human rights advocates who have documented the missing-person case of a Kurdish politician from Sirnak, Hursit Kulter, the first such disappearance since 2001.
“Erdogan today has been captured by the patriotic forces of Turkey,” said Dogu Perincek, the head of a nationalist political party close to the military, who was jailed for conspiring against the state but recently released.
Mr. Erdogan’s Achilles’ heel is the economy. His voters, while loyal, care about their pocketbooks more. Incomes have stagnated in recent years, and foreign direct investment, a major indicator of economic direction, has been declining, not counting real estate purchases.
“We have an ulcer, not cancer,” Atilla Yesilada, a financial consultant in Istanbul, said of the economy. “But all signs point toward sicker.”