Political newcomer liberal Robert Golob defeated Slovenia's three-time Prime Minister conservative Janez Jansa in elections on Sunday in a country split by bitter political divisions over the rule of law.

Golob's Freedom Movement (GS), which he launched only in January, has built on anger with Jansa's regime in the former Yugoslav state.

The opposition accuses Jansa of having tried to undermine democratic institutions and press freedoms since he returned to power in 2020.

Slovenia's Prime Minister Janez Jansa is seeking another term through elections billed by the opposition as 'a referendum on democracy'
Slovenia's Prime Minister Janez Jansa is seeking another term through elections billed by the opposition as 'a referendum on democracy' AFP / Jure Makovec

With almost all the votes counted in the country of around two million people, Freedom Movement (GS) stood at 34.5 percent of the vote compared to 23.6 percent for Jansa's Slovenian Democratic Party.

Robert Golob, leader of the liberal 'Freedom Movement' party
Robert Golob, leader of the liberal 'Freedom Movement' party AFP / Jure Makovec

"Our objective has been reached: a victory that will enable us to take the country back to freedom," Golob told jubilant supporters late Sunday.

"People want changes and have expressed their confidence in us as the only ones who can bring those changes," he said earlier via a livestream from his home where he was in isolation after contracting Covid-19.

The 55-year-old former power company manager has promised to restore "normality", having billed the elections as a "referendum on democracy".

Political analyst Miha Kovac said civil society and younger voters in particular had been mobilised. Analysts had expected an increased turnout and for voters to turn against Jansa's style.

The ascendancy of Robert Golob began when he took over a small Green party in January, renaming it Freedom Movement
The ascendancy of Robert Golob began when he took over a small Green party in January, renaming it Freedom Movement AFP / Jure Makovec

Turnout stood at some 70 percent of the 1.7 million electorate -- significantly higher than the 52 percent in the last parliamentary elections in 2018.

"The vote was a vote against Jansa," said Kovac. "Against Slovenia on the Hungarian path, against an illiberal democracy in Slovenia, against the government taking over the public television, against the control of judiciary."

But he warned that GS had no government experience -- even though it could partner with the more experienced Social Democrats (SD), who have 6.7 percent of the vote with almost all ballots counted.

A high turnout is predicted for the tight race between the PM's Slovenian Democratic Party and the upstart Freedom Party
A high turnout is predicted for the tight race between the PM's Slovenian Democratic Party and the upstart Freedom Party AFP / Jure Makovec

"It's like a company that abruptly grows," Kovac added. "It has no infrastructure, no know-how, no people that know how to work in parliamentary bodies."

Jansa, 63, an admirer of US ex-president Donald Trump, had campaigned on promises of stability.

"Ahead of the new government there are many challenges, but during our mandate we have set a solid ground for a peaceful navigation," he said late Sunday.

"It is easy to pay billboards, to have the backing of all media and the so-called civil society," he said. "But then hard work and challenges come, and there nothing of that can help you."

Uros Esih, a columnist at one of Slovenia's leading dailies Delo, told AFP ahead of the elections that they represented a "breaking point" with "liberal and illiberal political forces clashing" in Slovenia.

The rise of Golob began when he took over a small Green party without parliamentary seats in January, renaming it Freedom Movement.

He tapped into the protests that had developed since Jansa took power, as tens of thousands of people regularly attended anti-government rallies.

"I hope the situation will change... It is obvious that most of the people are not satisfied with this government and the way it's governing," Sara Rigler, a 21-year-old psychology student, told AFP at a polling station in the capital Ljubljana earlier Sunday.

Jansa's image has been hurt by rows with Brussels over his moves to suspend funding to the national news agency, and to drag out the appointment of prosecutors to the bloc's new anti-graft body.

Russia's invasion of Ukraine did not take centre stage in Slovenia's election campaign, although Jansa was among the first foreign leaders to travel to Kyiv, on March 15.

Only a year into his second term as premier however, he was forced out by a corruption scandal.