ISTANBUL--Turkey's unrivaled leader Recep Tayyip Erdogan was sworn in Thursday as the country's first popularly elected president, heralding a new political order in a critical Western ally after a monthslong campaign to consolidate power.

A flurry of ceremonies in the capital, Ankara, marked Mr. Erdogan's accession from prime minister to head of state as he took the oath of office in parliament. Deputies from the governing party gave Mr. Erdogan a standing ovation at the general assembly, while main opposition lawmakers walked out in protest, highlighting Turkey's polarized politics as the president assumed office with a pledge to unify the country.

"With the first popularly elected president taking office, today is the day that Turkey rises from its ashes, it's the day the process to build the new Turkey gains strength," Mr. Erdogan said as he visited the mausoleum of modern Turkey's founder and first president, Mustafa Kemal Ataturk.

Mr. Erdogan's inauguration as the country's 12th president marks a remarkable turnaround from just the beginning of the year, when his cabinet was besieged by a corruption scandal, a plunging currency and sporadic street protests. Critics say the way Mr. Erdogan surmounted those challenges--quashing dissent, casting old allies as villainous enemies, passing laws to centralize authority--could foreshadow his presidential style, even as he vowed to create a "new Turkey" based on economic growth and greater freedoms.

"Erdogan is trying to give the impression that his assumption of the presidency will mobilize Turkey in a new direction, but really, it's more of the same," said Fadi Hakura, director of the Turkey Project at Chatham House, a London-based think tank. "We're seeing power politics increasingly define the dynamics of the governing Justice and Development Party."

The new president has been working diligently to lay the groundwork for a smooth transition that would safeguard his place as the ultimate decision maker in Turkey--a feat that eluded previous prime ministers who ascended to the top post.

On Wednesday, Mr. Erdogan handed over the ruling Justice and Development Party, or AKP, to Foreign Minister Ahmet Davutoglu, who is slated to become prime minister Friday. The presidency is supposed to be a nonpartisan post, forcing Mr. Erdogan's resignation from the AKP.

"Our party's mission, the spirit of our cause, our goals and ideals are not changing. Today, only the names are changing," Mr. Erdogan said Wednesday.

Whether the carefully choreographed transfer will help Mr. Erdogan maintain his grip on cabinet and the AKP will be critical as the president tackles key initiatives.

Top of the agenda will be securing at least 330 of the 550 seats in parliament at the June 2015 general elections, which would enable the AKP to single-handedly rewrite the constitution.

That could provide Mr. Erdogan with his coveted U.S. or French-style presidential system, which he says would create a powerful executive office that can govern without parliamentary constraints.

"Turkey will inevitably discuss a presidential system, this will be one of the leading agenda items in front of us," said Mehmet Ali Sahin, deputy chairman of the AKP.

The party is well-placed to secure another parliamentary victory, emerging with 46% support from local elections in March and a first-round presidential vote win for Mr. Erdogan in August with 52% of the votes.

Meanwhile the president can use his public mandate to transform the hitherto symbolic post into an executive office, using constitutional powers previous leaders didn't exercise such as chairing cabinet meetings, Mr. Sahin said.

As Mr. Erdogan attempts to remodel the political landscape, he will also need to boost sluggish growth in Turkey's $820 billion economy, tackle a growing security threat as Islamic militants expand their footprint in neighboring Iraq and Syria, and repair strained ties with traditional Western allies.

But a pledge to continue a purge of political enemies allegedly working in state institutions is poised to dominate the president's first days in office. Mr. Erdogan accuses his former ally Fethullah Gulen, a U.S.-based Turkish imam, of plotting a coup and establishing a "parallel state" within the bureaucracy, a charge the cleric denies.

Already, the government has taken steps to control judiciary appointments and removed thousands of prosecutors and police chiefs from their posts, and arrested scores of security officials for illegally wiretapping government officials. The moves stoked concern about the rule of law among allies led by the U.S. and the European Union, a bloc Turkey seeks to join.

From the presidency, Mr. Erdogan is also likely to intensify his push to end a three-decade Kurdish insurgency, which has claimed more than 40,000 lives, the vast majority of them Kurds. The initiative, which recently has shown signs of strain, has been broadly hailed by many Turks and Kurds for stopping the bloodshed and laying the groundwork for a lasting solution.

"Nobody can fill the place of Erdogan," said Berat Tosun, a 30-year-old AKP member at the party convention in Ankara. "But we have a peace of mind because he will continue to be the leader in our hearts; he will not let his absence be felt."

Ayla Albayrak in Ankara contributed to this article.

Write to Emre Peker at emre.peker@wsj.com

Subscribe to WSJ: http://online.wsj.com?mod=djnwires