Slovakia was haunted by ghosts of its past on Sunday after far-right militants wearing uniforms modelled on a second world war Nazi puppet state won seats in parliament for the first time.

The People’s party – Our Slovakia group led by Marian Kotleba, the governor of central Slovakia who has organised marches against the Roma minority, took 8% of the vote, nearly three times more than polls had predicted.

Slovakia’s prime minister, Robert Fico, won Saturday’s parliamentary election, nearly complete results showed. But gains by opposition parties including the far right will make it difficult to form a new government.

If Fico fails to put together a government led by his leftist Smer party, a group of centre-right parties could try to form a broad, but possibly unstable, anti-Fico coalition in a repeat of the 2010 election.

Fico, a leftist whose anti-immigration and socially conservative views are in line with neighbours Poland and Hungary, took 28.3% of the vote, far ahead of others but less than he had hoped for.

Analysts say the far right capitalised on the anti-immigration rhetoric from most mainstream parties including Fico.

“Robert Fico has taken one of the toughest attitudes to the migration crisis among EU politicians but the result was not extremists under control but extremists in the parliament,” Dalibor Rohac from the American Enterprise Institute said.

Gains by opposition parties will make it difficult for Slovakia’s prime minister, Robert Fico, above, to form a new government. Photograph: Petr David Josek/AP

Members of Kotleba’s former “Slovak brotherhood” party, dressed in black uniforms reminiscent of the Nazi-era Hlinka guard, first appeared at rallies commemorating the 1939-45 Slovak state led by a Catholic priest, Jozef Tiso, who allowed tens of thousands of Slovak Jews to be deported to Nazi death camps. The party was disbanded for spreading hatred in 2006.

Kotleba has since founded a new party, changed his uniform for a blazer and replaced war rallies with anti-Roma, anti-immigration and anti-corruption rhetoric.

His party rejects suggestions of links with Nazi ideology and focuses on criticism of the European Union and Nato.

“We are not fascists or neo-Nazis although we might appear extremist compared to other lukewarm parties,” one of its newly elected lawmakers, Milan Uhrik, said. “We will stay in opposition for now, but I believe that if there’s a snap election we will win by a landslide.”