ISTANBUL (AP) — Turkish President Recep Tayyip Erdogan took a commanding lead in his bid Sunday for a presidency with broadly expanded powers, with partial results reported by the country's state-run news agency showing him with more than 50 percent of the vote — enough to avoid a runoff.

The high-stakes presidential contest and a parliamentary election also held Sunday were set to either consolidate Erdogan's grip on power or curtail his vast political ambitions. The vote will complete Turkey's transition from a parliamentary to a new executive presidential system, a move approved in a referendum last year.

For an outright win in the presidential race, Erdogan needs more than 50 percent of the vote to avoid a run-off on July 8.

With nearly 80 percent of the country's ballot boxes counted, Erdogan was at 54.3 percent of the vote, with his main rival Muharrem Ince at 29.9 percent, according to the state-run Anadolu news agency. Kurdish candidate Selahattin Demirtas, who ran his campaign from jail, where he is being held pending trial on terrorism-related charges, was garnering 7.2 percent. He has called the charges trumped-up and politically motivated.

In the parliamentary vote, with 74 percent of ballot boxes counted, Erdogan's People's Alliance, which includes his AK party and a small nationalist party, stood at 55.7 percent, while the opposition Nation Alliance grouping together nationalists, secularists and a small Islamic-leaning party, was at 32.9 percent.

The pro-Kurdish People's Democratic Party, or HDP, was edging past the 10 percent threshold to enter parliament, with 10.15 percent. If the HDP manages to get into parliament, it could reduce the number of seats Erdogan's alliance will hold, threatening his parliamentary majority.

Erdogan, 64, is seeking re-election for a five-year term with hugely increased powers under the new system, which he insists will bring prosperity and stability to Turkey, especially after a failed coup attempt in 2016 that has left the country under a state of emergency. His ruling Justice and Development Party, or AKP, is hoping to retain its majority in parliament.

Ince, speaking just after polls closed, warned civil servants involved in the vote count to do their jobs "abiding by the law" and without fear, suggesting they were under pressure by the government. He asked all Turks to be vigilant at polls and not be "demoralized" by what he called the possible manipulation of news.

Erdogan, who has been in power since 2003, has faced a more robust, united opposition than ever before. Opposition candidates vowed to return Turkey to a parliamentary democracy with strong checks and balances and have decried what they call Erdogan's "one-man rule."

The incumbent is the most powerful leader since the founder of the Turkish republic, Mustafa Kemal Ataturk. He remains popular in the conservative and pious heartland, having empowered previously disenfranchised groups.

From a modest background himself, Erdogan has presided over an infrastructure boom that has modernized Turkey and lifted many out of poverty while also raising Islam's profile, for instance by lifting a ban on Islamic headscarves in schools and public offices.

But critics say he has taken an increasingly authoritarian bent. The election campaign was heavily skewed in his favor, with opposition candidates struggling to get their speeches aired on television. Erdogan directly or indirectly controls most of Turkey's media.

Five candidates were running against Erdogan in the presidential race.

"With these elections, Turkey is achieving a virtual democratic revolution," Erdogan told reporters after voting in Istanbul. He said turnout appeared to be high and that "no serious incidents" had occurred.

Ince, a 54-year-old former physics teacher, is backed by the center-left opposition Republican People's Party, or CHP. He has wooed crowds with an unexpectedly engaging campaign, drawing massive numbers at his rallies in Turkey's three main cities of Istanbul, Ankara and Izmir.

Also challenging Erdogan is 61-year-old former Interior Minister Meral Aksener, the only female presidential candidate in the race. She broke away from Turkey's main nationalist party over its support for Erdogan and formed the center-right, nationalist Good Party.

More than 59 million Turkish citizens, including 3 million expatriates, were eligible to vote. Erdogan called the election more than a year early in what analysts say was a pre-emptive move ahead of a possible economic downturn.

Turkey was also electing 600 lawmakers to parliament — 50 more than in the previous assembly. The constitutional changes have allowed parties to form alliances, paving the way for Ince's and Aksener's parties to join a small Islamist party in the "Nation Alliance" against Erdogan.

The head of Turkey's electoral commission said authorities had taken action following reports of irregularities at voting stations in southeastern Turkey. Videos posted on social media appeared to show people voting in bulk at a ballot box in the town of Suruc in Sanliurfa province.

The Organization for Security and Cooperation in Europe was monitoring the elections with over 350 observers. Election monitors criticized Turkey for denying entry to two monitors who Turkey accused of political bias.

Peter Osusky, head of the OSCE Parliamentary Assembly delegation, told The Associated Press all observers "are strongly adhering to so-called code of conduct" regardless of their political opinions.

Recent changes to electoral laws allow civil servants to lead ballot box committees. Ballot papers that don't bear the official stamps will still be considered valid — a measure that led to allegations of fraud in last year's referendum.

Citing security reasons, authorities have relocated thousands of polling stations in predominantly Kurdish provinces, forcing some 144,000 voters to travel further to cast their ballots. Some will even have to pass through security checkpoints to vote.

The vote took place under a state of emergency declared after the failed coup attempt, which allows the government to curtail civil rights. Some 50,000 people have been arrested and 110,000 civil servants have been fired under the emergency powers, which opposition lawmakers say Erdogan is using to stifle dissent.

The pro-Kurdish HDP has seen nine of its lawmakers and thousands of party members arrested by the government and says more than 350 of its election workers have been detained since April 28.

__

Fraser reported from Ankara. Mehmet Guzel in Ankara contributed.

Copyright 2018 The Associated Press. All rights reserved. This material may not be published, broadcast, rewritten or redistributed.