Updated

The new Czech government won a mandatory confidence vote in the lower house of Parliament early Thursday, ending months of political instability following October's general elections and giving the far-left Communists a role in governing for the first time since the country's 1989 anti-communist Velvet Revolution..

The government is led by populist billionaire Andrej Babis as prime minister. His centrist ANO (YES) movement won the election, but his first minority government lost a confidence vote in January and had to resign.

The government's creation took such a long time because most other parties in Parliament have been reluctant to enter a coalition with ANO because of fraud charges facing Babis, who denies wrongdoing.

Babis' second government is made up of ANO and leftist Social Democrat deputies and it also doesn't have a parliamentary majority. It was sworn in June 27.

Babis struck a controversial power-sharing deal with the Communist Party to carve out the 105-91 vote early Thursday that put through the confidence measure required to govern,

Protesting the rising influence of the Communists, hundreds protesters rallied near the parliament building during the daylong debate. Thousands recently took to the streets to protest the planned pact with them.

The governing coalition and the Communists are united in rejecting any compulsory distribution of migrants in the European Union.

Babis has also agreed to meet the Communist Party's demand to tax the compensation that the country's churches receive for property seized by the former Communist regime. The Communists are vocal opponents of the payment.

The deal between Babis and the Communists ensured the government's victory in the confidence vote but it is too vague to give a clear picture of the future influence of the Communists on the government.

The hardline party is vehemently opposed to NATO and has friendly ties with the ruling communists in Cuba, China and North Korea. The Communists also oppose the deployment of Czech troops abroad, particularly to the Baltics and Poland as part of NATO missions amid the tension between Russia and the West.

Along with its anti-migrant stance, the new government opposes setting a date for the Czech Republic to adopt the EU's common euro currency.

The new Cabinet has been under the strong influence of pro-Russian President Milos Zeman, who is known for an anti-migrant rhetoric. It still doesn't have a proper foreign minister after Zeman rejected a candidate for the post over his purportedly sympathetic views of migration.