ANKARA, Turkey — Just before Prime Minister Recep Tayyip Erdogan’s motorcade swept into the airport here, workers rolled up a red carpet that had been used for the departing president and put down a turquoise one for Mr. Erdogan.
Turquoise was the primary color of the Ottoman Empire, and Mr. Erdogan’s preference for it is a subtle, yet telling, symbol of his ambitions as he campaigns to become president — crisscrossing the country in a bid to expand his pre-eminence over Turkish political life and become, as many of his critics put it, a modern-day sultan.
On Sunday, Turks, for the first time in history, will vote for their president, a position that on paper is largely, but not entirely, ceremonial. As the campaign has unfolded, any sense of its historical importance has been eclipsed by a sense of certitude: Mr. Erdogan is widely expected to win, and widely expected to govern the country from the presidential palace.
“When you look at our Constitution, there is no article that limits actions of a president,” Mr. Erdogan said in a recent interview on his plane, as he returned to Ankara, the Turkish capital, from a campaign stop in Mersin, a port city on the Mediterranean coast. “It names the president as the head of state, that’s it.”
Mr. Erdogan’s determination to run the country from the presidency, despite traditional limitations on the powers of the office, has evoked comparisons to Vladimir V. Putin of Russia, who has dominated that country’s politics at different times as either prime minister or president. Turkey’s current president, Abdullah Gul, who was chosen by Parliament, has served since 2007.
In running for president, Mr. Erdogan is hoping to secure a legacy greater even than that of the revered founder of modern Turkey, Mustafa Kemal Ataturk. Mr. Erdogan, already in power more than a decade, hopes to preside over the nation for another 10 years and be the leader at the 100th anniversary of the Turkish republic in 2023.
For better or worse, he has already left an imprint on Turkish public life almost as large as Ataturk’s. He has sidelined the military from a role in politics, and broken down secular taboos to allow more religious expression, such as the wearing of head scarves on college campuses and in Parliament. He has achieved enormous popularity among his religiously conservative base, with a politics that fuses faith and populism, and his economic policies have improved the lives of many who felt like second-class citizens under Turkey’s old secular system.
“He made Turkey a country of prestige, of confidence,” said Nuri Guven, 34, cheering for Mr. Erdogan at the rally in Mersin.
At the rally, holding his fist in the air, Mr. Erdogan said to his supporters, “Allah is enough for us, people are enough for us, Turkey is enough for us.”
Mr. Erdogan has also pushed Turkey into a more active role in the Middle East, presenting the country, with its growing economy and mix of Islamic and democratic credentials, as a model for an Arab world in turmoil. In practice, though, he has few foreign policy successes to point to. Turkey’s support of the Muslim Brotherhood in Egypt ended with the Islamist group’s president, Mohamed Morsi, being ousted by the military and hundreds of his supporters killed.
Mr. Erdogan was an early supporter of the Syrian rebels fighting President Bashar al-Assad, a policy that now seems to have been a bad miscalculation, as analysts and foreign powers blame Turkey, partly, for the rise of the extremist Islamic State in Iraq and Syria. Turkey’s formerly lax border policies, analysts say, allowed ISIS to flourish and move men and guns into Syria.
Turkey, a NATO member, has long been a strategic ally of the United States. At the outset of the Arab Spring revolutions, in 2011, President Obama developed a close personal relationship with Mr. Erdogan, seeing Turkey as a model to emulate for countries upended by revolution.
But the relationship has lately been badly damaged over differences on Egypt and Syria. It took another blow when Mr. Erdogan suggested that a conspiracy involving the United States was behind a wide-ranging corruption investigation that targeted him and his inner circle. Mr. Erdogan has blamed the followers of Fethullah Gulen, a popular cleric in self-imposed exile in the United States whose supporters occupy positions in Turkey’s police and judiciary, for the corruption probe, and demanded that the United States extradite Mr. Gulen.
Nowadays, Mr. Erdogan no longer speaks directly to Mr. Obama, he said.
“Why did the U.S. remain silent when a popularly elected Morsi was ousted in a military coup?” Mr. Erdogan said in the interview. “Why did the West remain silent? And so, they also asked us to remain silent. When we called it a military coup, they looked at us in a wrong way, and there, ties were cut. We will, however, continue to say the same thing.”
Mr. Erdogan’s rule has come at the cost of deep polarization in Turkish society.
The public is divided almost exactly in half between those who support Mr. Erdogan and his Islamist Justice and Development Party, and others who despise him for what they regard as his authoritarian streak. His opponents, though, are also sharply divided, between nationalists, those loyal to the secular principles of Ataturk, and more liberal, urban Turks who formed the backbone of a protest movement that convulsed the streets of Istanbul and other cities last summer. Two candidates are running against Mr. Erdogan: Ekmeleddin Ihsanoglu, a former diplomat, and Selahattin Demirtas, the candidate of a pro-Kurdish party.
But neither of these candidates has been able to unite the various factions among Mr. Erdogan’s opponents, and so Mr. Erdogan is almost certain to win in the voting this Sunday. If he does not receive at least 50 percent of the votes on Sunday, the election would go to another round, on Aug. 24, between the top two finishers.
“It’s almost a foregone conclusion that Erdogan will win,” said Sinan Ulgen, a former Turkish diplomat affiliated with the Carnegie Endowment for International Peace in Brussels.
So certain are Turks of Mr. Erdogan’s imminent victory that the national teachers union recently published a test preparation book that lists Mr. Erdogan as having been elected president in 2014.
Nevertheless, the stakes are high for Turkish politics. As president, Mr. Erdogan is expected to wield more power from an office that has traditionally been subordinate to the prime minister — for example, chairing regular cabinet meetings under a constitutional provision that has been exercised rarely in the past. He is also likely to push for constitutional changes to create a powerful presidential system, and while he is required by law to sever ties with his party, few believe he will do so in practice.
An open question is who would replace him as prime minister. Analysts say that for Mr. Erdogan to govern from the presidency he would have to install a compliant party figure as the head of Parliament.
Mr. Ulgen said, “This is really the big question that will determine the short-term evolution of Turkish politics.”
Sebnem Arsu reported from Ankara and Mersin, Turkey, and Tim Arango from Baghdad. Ceylan Yeginsu contributed reporting from Istanbul.