BUDAPEST, Hungary (AP) — A candidate from Hungary's far-right Jobbik party was narrowly ahead of a rival from Prime Minister Viktor Orban's Fidesz party in a parliamentary by-election on Sunday.

With 99.1 percent of the votes counted, Jobbik's Lajos Rig had the support of 35.3 percent, Zoltan Fenyvesi of Fidesz had 34.4 percent and Socialist Ferenc Pad had 26.3 percent.

Jobbik president Gabor Vona described the victory as "historic."

"The mood in Hungary is for a change of government and with Jobbik Hungary finally has a force to change the government," Vona told supporters celebrating in the western Hungarian city of Tapolca.

If the result is confirmed, it would be the second straight defeat this year for Fidesz, which lost its two-thirds parliamentary majority in a February by-election.

With around 500 votes left to count, Rig had 261 more votes than Fenyvesi and analysts said it was highly unlikely Fidesz could reverse the result.

"Fidesz is caught in a downward spiral from which it will be very difficult to exit," said Peter Krausz, an analyst at Budapest's Policy Agenda.

Jobbik, some of whose politicians have made numerous anti-Semitic and anti-gypsy statements, has been trying recently to soften its rhetoric, though critics remain unconvinced.

"In the eyes of the rest of the world, people see Jobbik as an extremist party that promotes hate," Ronald Lauder, head of the World Jewish Congress, said Sunday at a Budapest Holocaust remembrance.

Despite its likely victory in Veszprem County and Vona's high expectations, Krausz said Jobbik still had a long road ahead before it could win national elections, expected in 2018.

"It seems impossible that anyone in the United States or Europe would accept a Jobbik government," Krausz said. "What looks certain for now is that many of the voters disillusioned with Fidesz are supporting Jobbik instead."

Fidesz easily won national, municipal and European elections in 2014 but has lost popularity due to corruption scandals and disputed measures like a ban preventing most stores from opening on Sundays.