Hungary's opposition scored its biggest election victory in a decade on Sunday when opposition challenger Gergely Karacsony defeated ruling party-backed incumbent Istvan Tarlos in the Budapest mayoral election. Since 2013, Karacsony is a member of the Hungarian green party Dialogue for Hungary.

With 81.6% of votes counted, Karacsony had 50.6% support compared with 44.3% for Tarlos according to data on the National Election Office website, putting the Hungarian opposition on track for its biggest political win in a decade.

Opposition parties were also projected to win a majority in the Budapest General Assembly with 17 members, compared with 14 delegates from Prime Minister Viktor Orban’s ruling Fidesz-Christian Democrat alliance and two independents.

"This is the first step towards changing Hungary," Karacsony said in a Facebook post. "We will take Budapest back to Europe."

Budapest is home to about a fifth of Hungary’s population of 10 million, but it is responsible for more than a third of its economic output and plays an outsized role in all walks of national life.

"We gave everyone a lesson on democracy. ... An opposition unity that voters have long expected has been formed, and the result tells us this is the path to take onwards," Karacsony told cheering supporters.

Gergely Karacsony, opposition parties' candidate delivers a statement after his victory after being elected Mayor of Budapest, defeating the ruling party. REUTERS/Bernadett Szabo REUTERS/Bernadett Szabo

"Changing Budapest and the major cities is the first step toward changing Hungary," he said.

The result will not affect Prime Minister Viktor Orban's grip on national power. His ruling Fidesz party remains wildly popular in rural areas.

No general election is due until 2022 and Orban, who's been in power since 2010, holds a huge majority in parliament.

But Sunday’s nationwide local elections were seen as a key test of an opposition strategy of rallying behind a single candidate against Fidesz, which has scored seven consecutive landslide election wins since 2010 on the national, municipal and European levels.

Naz Masraff, an analyst at think tank Teneo Intelligence said the opposition's showing could solidify cooperation between opposition parties ahead of the 2022 general election.

"But forming a wide opposition project will still prove to be very difficult ahead of parliamentary elections, given the need to align diverging priorities ranging from the centre-right Jobbik to Liberal Momentum," he said in a note before Sunday's vote.

Opposition political parties succeed in their "cooperation strategy"

Gergely Karacsony won in 14 districts of Budapest, out of 23, and in 10 towns with county status. All political parties opposed to government's ruling party Fidesz agreed to run with one common candidate in Budapest -from the far-right party Jobbik to the Hungarian Socialist Party, the liberals (Momentum) and the greens (LMP)- a strategy that has been proven successful in the main Hungarian cities.

Fidesz, the governing party, has more mayors than the opposition -600 hundred versus some dozens-, but in terms of population one-third of Hungarian citizens will live in a city ruled by the opposition after yesterday's election.

Viktor Orban's party also maintains the majority in all county assemblies (19), with the only exception of Budapest, and has even improved its results in rural areas.

This electoral campaign has unveiled all kind of scandals to undermine the reputation of the candidates, mainly towards Karacsony. Fidesz alleged that he had a pro-migration stance and insistently remarked his "ineptitude" for the job.

On the other side, it was also unveiled that the Fidesz mayor in the western city of Gyor's, Zsolt Borkai, was involved in a sex scandal, same as the opposition backed candidateTamás Wittinghoff.