THIS year is not going well for Viktor Orban, Hungary’s prime minister. After falling out with a key oligarch and ally, Mr Orban’s right-wing Fidesz party has lost two by-elections. The loss of Veszprem in February to a left-winger cost Fidesz its two-thirds majority in parliament. But its defeat in Tapolca on April 12th has even bigger implications. Lajos Rig took the seat for Jobbik, an extreme-right party, with 35.3% of the vote to Fidesz’s 34.4 %. The left-wing candidate trailed with 26.3%.

Modern, decentralised campaign tactics helped Jobbik to win. Whereas Fidesz ran an old-fashioned air war, parachuting in party leaders, including Mr Orban, only for brief visits, Jobbik ran a well co-ordinated ground war, flooding the constituency with MPs and activists, targeting villages and focusing on local concerns such as Tapolca’s hospital.

Gabor Vona, Jobbik’s leader, hailed the victory as a “historic event”. Jobbik, not the left, he said, was now the main challenger to Fidesz. This is the first time Jobbik has won a seat directly, rather than through the national-list system. That is a potential game-changer, says Akos Balogh, of mandiner.hu, a conservative news portal. “Jobbik has the second-strongest campaign machine and it is still building it up.”

Fidesz still leads in most polls, but it is losing ground. Last year it won Hungary’s national, local and European elections. But a row with America over corruption, Mr Orban’s cosying up to Russia’s Vladimir Putin and the flashy lifestyles of some Fidesz leaders are eroding its support.

A poll by Median in March gave Fidesz 24% support, Jobbik 15% and the Socialists 11%. A fractured, ineffectual left, devoid of new ideas, has boosted Jobbik’s appeal, especially among the young. Fidesz lacks a convincing response to Jobbik, says Peter Kreko, of Political Capital, a think-tank. The government has no clear new objectives, no narrative; it is just conducting a “raw struggle for power”, Mr Balogh argues.

Curiously, Jobbik’s victory may ease foreign pressure on Mr Orban. The prime minister has long presented Fidesz as the best bulwark against the extreme right. If Fidesz lost the next election, his successor might be even less palatable to Hungary’s allies than he is.

Like Marine Le Pen, leader of France’s National Front (see article), Mr Vona wants to detoxify his brand. There is no longer public talk of “gypsy crime” or open anti-Semitism, though Jobbik remains virulently anti-Israel. The Magyar Garda, the party’s black-uniformed wing, has been disbanded after being banned. Mr Vona says he wants to transform Jobbik into a “people’s party” and knows “where to draw the line”. The rebranding exercise has been largely successful, says Mr Kreko. The party’s political content has not softened, but voters no longer see it as extremist.

The past is less easy to expunge, especially in social media. Mr Rig once shared a Facebook post that described the Roma as the “Jews’ weapon against Hungarians”. The post has been removed from his page: Mr Rig told Reuters he redistributed it without paying attention to its contents. On April 12th thousands took to the street in Budapest to commemorate the Holocaust, and heard Ronald Lauder, president of the World Jewish Congress, denounce Jobbik as “an extremist party that promotes hate”. But the voters may not be listening.