LJUBLJANA, Slovenia — Slovenian lawmakers on Thursday endorsed a center-left government in a tight vote that still keeps the power away from anti-immigrant populists who topped the polls in June's election.

The government of Prime Minister Marjan Sarec — a former comedian — bucks the trend in Central Europe, where populists have swept to power in elections from Italy to Poland.

Sarec's cabinet received support from 45 lawmakers in the 90-member assembly — just enough for the endorsement. The tight vote suggests Sarec faces a tough job of keeping his government afloat.

A novice in Slovenian politics, the 40-year-old Sarec leads a minority government that is a coalition of five center-left parties that have joined forces to sideline the right-wing winner of the June 3 parliamentary vote.

The government also has sought the backing of a separate, left-wing group in parliament. Thursday's vote was secret, meaning that it was not clear which of the lawmakers supported the cabinet.

Slovenia was once part of Yugoslavia and is the native home of U.S. first lady Melania Trump. Bordering Austria, Croatia, Hungary, Italy and a slice of the Adriatic Sea, the nation of about 2 million joined the European Union in 2004 and has used the euro as its official currency since 2007.

Some analysts in Slovenia have predicted the government will be unstable because it consists of several diverse groups and depends for its ability to pass legislation on the left-wing party.

Already, Slovenian businesses have expressed fear that support from The Left party, which advocated improvements to the welfare system, will force the government to raise taxes to meet its demands.

Sarec, who gave up performing on stage to become the mayor of the central Slovenian town of Kamnik, told parliament earlier Thursday that his government is ready to take up its responsibilities.

"It is easier to observe from the side and criticize than to do something," he said. "It is time to start working now."

Though the Slovenian Democratic Party of former prime minister Janez Jansa topped June's election, it failed to garner enough support to govern alone. Other parliamentary groups in the traditionally moderate Alpine nation have refused to cooperate with Jansa, who is an ally of Hungary's anti-immigrant Prime Minister Viktor Orban.

The former prime minister said Thursday he anticipates "very serious headaches" for Sarec in leading a government that he described as a "recycled" version of previous left-leaning administrations that will bring no good for Slovenia.

Janez Markes, an analyst from the Delo newspaper, predicted that Jansa will provide stiff opposition to Sarec's government.

"This is the government against something ... so I suppose this government is going to be a little bit colorless," Markes said. "But this minority (government) can last, maybe for four years, who knows."