Janša, who had hoped to win a fourth term, admitted that he had been defeated in the vote, but added that his SDS party had secured more votes than ever before.
“The results are what they are. Congratulations to the relative winner,” said Janša, addressing his supporters.
The election was expected to be tight, but the official preliminary figures showed that the Freedom Movement, a newcomer to the election, led with 34.34% of the vote, far more than expected, while SDS secured 23.83%, based on 98.20 % of the ballot papers counted.
It would give the Freedom Movement, which campaigned for a transition to green energy, an open society and the rule of law, 40 seats in parliament with 90 seats and the SDS 28 seats.
The turnout in the poll, where about 1.7 million people were eligible to vote in the small Alpine country that is a member of the EU and NATO military alliance, was 68%, the election commission said.
Experts said it was well above the national average.
“The biggest winner, of course, is the Freedom Movement,” said Peter Merše, a political analyst. “Slovenia is experimenting again with new faces, with people we have hardly even heard of before.”
The Freedom Movement, which was formed last year, is led by Robert Golob, a former head of a state-owned energy company that launched green energy projects.
In order to form a government, it is expected to form a coalition with the left-wing Social Democrats and Left parties, which currently stand to have a total of 12 seats in the Folketing.
Golob, 55, who is believed to have contracted Covid-19, thanked his celebrating supporters for the historic turnout via a video call.
“It does not mean that we are the unique ones, it means that people really want change,” he said. “So today people are dancing, but tomorrow is a new day. Tomorrow we will start working hard to justify trust.”
Janša, the 63-year-old populist who has clashed with Brussels over media freedom and has been accused by opponents of undermining democratic standards, which he has denied, said the new government will face many challenges and he hoped that it will be up to the task. .
Many people interviewed by Reuters said they wanted change.
“We do not want these politicians in power anymore,” said Milena, 58, who cast her vote in the capital Ljubljana. “The last two years have been desperate in every way. We want new faces, we want normality and stability.”