LJUBLJANA, Slovenia — The government of Slovenia's right-wing prime minister has survived a no-confidence motion tabled by the opposition, who accused him of using the coronavirus pandemic to curb democratic freedoms.

Prime Minister Janez Jansa survived the vote held by parliament late Monday, when the opposition only mustered 40 votes in the 90-member assembly, leaving it six votes short of the needed majority to oust the government.

Jansa, a nationalist politician with close links to hardline Hungarian Prime Minister Viktor Orban, has described the opposition attempt as a "destructive farce" and a waste of public money.

The center-left parties that filed the motion said the vote was necessary to try and avert Jansa's bid to undermine democracy in the traditionally moderate European Union nation.

Karl Erjavec, a former foreign minister who is the leader of the Pensioner's DESUS party, told lawmakers they faced a choice between an autocracy and a constitutional democracy.

Erjavec, who was put forward as a replacement for Jansa should the vote have succeeded, also said government measures against the new coronavirus were designed to constrict people's freedoms while doing little to control the epidemic.

Slovenia has reported more than 3,700 confirmed deaths from the new coronavirus in the country of some 2 million people. The government days ago has eased some of the anti-virus rules after the numbers of daily new infections stabilized.

Since he came to power last March, Jansa has faced accusations of pressuring the media and undermining the rule of law. He has denied the allegations.

During the U.S. elections, Jansa came into focus when he openly backed former President Donald Trump and congratulated him before the vote count was finished. Jansa is also known for his staunchly anti-immigrant views.

The current center-right coalition government was installed in March after a left-leaning prime minister stepped down. A regular parliamentary election is due next year.