By Gergely Szakacs and Marton Dunai
BUDAPEST (Reuters) - Hungary's opposition scored its biggest election victory in a decade on Sunday when liberal challenger Gergely Karacsony ousted ruling-party incumbent Istvan Tarlos as mayor of Budapest and opposition parties made gains in other major cities as well.
The result will not affect Prime Minister Viktor Orban's grip on national power as his Cabinet is buoyed by a strong economy, fierce anti-immigration rhetoric and hefty wage rises. His ruling Fidesz party remains wildly popular in rural areas.
No general election is due until 2022 and Orban, who rose to power in 2010, holds a huge majority in parliament.
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.
The better-than-expected showing for the opposition, including a late surge by the 44-year-old Karacsony, vindicated its strategy to field joint candidates, seen as the best way to challenge Fidesz, which had scored seven consecutive landslide election wins on the national, municipal and European levels since 2010.
"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.
"Changing Budapest and the major cities is the first step toward changing Hungary," he said as 71-year-old Tarlos, the Budapest mayor since 2010, conceded defeat.
Opposition parties were also on track to win a majority in the Budapest General Assembly and made gains outside the capital, with preliminary results projecting opposition mayors winning in 10 of Hungary's 23 big cities.
"Today, the citizens of Budapest have decided that the time has come for something different," Orban told a news conference. "We accept this decision. In the interests of the country and the citizens of Budapest, we are ready to cooperate."
Orban said Fidesz was expected to win the mayoral races in over half of the towns with a population exceeding 5,000 people, adding that the number of votes cast nationwide showed his right-wing alliance remained the strongest in Hungary.
Orban said, however, that Fidesz would need to pore over the election results and make adjustments to its policies. But he did not go into detail.
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 center-right Jobbik to Liberal Momentum," he said in a note before Sunday's vote.
(Reporting by Gergely Szakacs and Marton Dunai; Editing by Daniel Wallis and Peter Cooney)