A voter enters a booth at a polling station during presidential and parliamentary elections in Ankara, Turkey. (Mustafa Kirazli/Getty Images)

ISTANBUL — Turkish voters Sunday began casting their ballots in a pivotal election that could cement the authority of an already powerful president or overturn his party’s years-long rule.

President Recep Tayyip Erdogan, the 64-year-old incumbent, is seeking re-election for another five-year-term. But he also faces an energized opposition that has united largely around secular candidate, Muharrem Ince, 54, a former physics teacher whose rallies have drawn millions across the country.

A broad coalition led by Ince is also challenging the ruling Justice and Development Party (AKP) in parliament, where the president’s allies have governed for more than a decade. The People’s Republican Party, or CHP, is the largest opposition party in parliament.

If no presidential candidate receives more than 50 percent of the vote, the election will go to a run-off July 8, in what some observers say would be blow to Erdogan, who has cultivated an image of authority and invincibility.

The polls — for which more than 55 million Turkish voters are registered — will also finalize Turkey’s transition to an executive presidency, which was narrowly approved in a contentious election last year.

That system, designed by Erdogan and the AKP, would weaken parliament and the judiciary and strengthen the president’s authority. Critics say it would allow Erdogan to effectively rule by fiat, while curbing independent checks on his power.

Turkey has been under emergency rule since a failed coup attempt in 2016, after which the government launched a sweeping crackdown on opponents and those it said participated in the rebellion. Tens of thousands have been arrested or dismissed from government posts, and Erdogan’s allies control most major media outlets.

This week, Turkish authorities refused entry to two observers with the Organization for Security Cooperation in Europe, an intergovernmental organization based in Vienna.

The OSCE has “expressed concern about conducting elections under emergency rule as potentially jeopardizing the integrity of the election process,” its interim report on the elections says.

One opposition candidate, Selahattin Demirtas of the pro-Kurdish People’s Democratic Party, is running his presidential campaign from a jail cell, where he has been detained on terrorism charges since November 2016.

The president remains popular, however, for lifting Turkey out of economic obscurity. He has presided over massive infrastructure projects and appeals particularly to pious Sunni voters.

He called surprise snap elections in April, more than 19 months ahead of schedule, in a move observers said aimed to preempt any challenge from the opposition.

“God willing, Turkey will start flying with this system,” Erdogan said of the executive presidency at a rally in Istanbul Saturday, the Reuters news agency reported.

“With this system, we will achieve what others cannot imagine,” he said.