BERLIN — Hungary's opposition parties on Sunday banded around a single candidate to try to unseat Prime Minister Viktor Orban, the populist leader accused of chipping away at the country's democracy during more than a decade in power, in next year's election.

Peter Marki-Zay, a conservative small-town mayor who was once considered an outsider, won the second round of the primary with 57 percent of the vote. “We have to move forward together,” he told reporters before the results came in.

“We are not lone fighters,” he continued. “We all have to represent the whole opposition, and not even just them.”

An observant Catholic father of seven, Marki-Zay, 47, presented himself as the stronger of two finalists to run against Orban because he would be challenging him from the right rather than the left. His opponent, Klara Dobrev, from the left-wing Democratic Coalition congratulated him on his win.

Dobrev, 49, vice president of the European parliament, faced the challenge of her marriage to former prime minister Ferenc Gyurcsany, who was the target of large-scale street protests in 2006 and one of the most controversial figures in Hungarian politics.

The results on Sunday were the culmination of weeks of voting and campaigning in an effort to bring together six parties with wide-ranging ideologies, from leftists and socialists to the former far right, behind a single candidate they hoped would loosen Orban’s grip on power in the April election. More than 650,000 people voted in hundreds of polling stations set up around the country in a partly crowdfunded effort to find a joint candidate.

It will be an uphill battle to win against a leader accused of centralizing power, gerrymandering and exerting control of the media to such an extent that Freedom House no longer classes Hungary as a democracy, but a “hybrid regime.”

But it’s considered the best chance the opposition has had at ousting Orban’s Fidesz party since it came to power in 2010. An average of national polls compiled by Politico put Fidesz and the united opposition neck and neck.

“It gives the opposition for the first time reasonable odds,” said Gabor Gyori, a senior analyst at the Budapest-based think tank Policy Solutions. “There is a greater possibility of him losing than in any election before.”

Marki-Zay has proved he can win against Fidesz. In 2018, when he was a little-known independent, he won a major upset in the mayoral race in the southern town of Hodmezvasarhely, which had been considered a stronghold for Orban’s party.

“He has shown that Fidesz can be defeated in a rural district, and this is a must for the opposition,” Gyori said. “It’s not enough to win the urban areas.”

Marki-Zay’s win in Hodmezvasarhely made beating Orban by joining forces appear to be possible. The opposition used the strategy in local elections in 2019 and won majorities of districts in Budapest and other cities.

“It worked,” said Robert Laszlo, an analyst with the Political Capital think tank. He said electoral law changes made by Fidesz have helped to necessitate such broad-based pre-election coordination.

Until now, the presence of the far-right Jobbik party had prevented such cooperation on a national level, but it has rebranded in recent years and said it is moving to the center, making it more palatable for other parties to work with it.

April will see the tactic put to the test for the first time in national parliamentary elections. With electoral map boundaries adjusted by the ruling party, Laszlo said, the opposition will need to win the popular vote by more than a few points.

The pact means that the opposition will run a joint candidate in all 106 directly elected seats across Hungary.

During a heated final round of the campaign, Dobrev had accused Marki-Zay of turning the race into a smear campaign and a “Trump-style life-or-death fight.” She said he would not be able to keep the disparate strands of the opposition coalition together.

But as the results came in on Sunday night, she called on her supporters to unite behind her rival. “I would like to tell all of you, those who are celebrating tonight, but especially those who might be a bit disappointed,” she said in a televised address. “We cannot be concerned with each other anymore. We only have to be concerned about one thing.”

That thing, she said, is how to defeat Orban. “This is the common responsibility and task of all of us.”

Fanni Matyasovszki in Budapest contributed to this report.