Italy’s new coalition government between the centre-left Democratic party and the anti-establishment Five Star Movement has been sworn in, with many analysts casting doubt on how long it will last.

The two parties are longstanding enemies. Should they fail, fresh elections might lead to them being punished and open the way for a comeback by Matteo Salvini, the leader of the far-right League who on Thursday was placed under investigation on suspicion of defaming the captain of a German migrant rescue ship.

The coalition looks likely to break from some of the hardline immigration measures pushed by Salvini, who was the interior minister in the last government.

Italy was plunged into chaos last month when Salvini withdrew the League from its fractious alliance with the Five Star Movement (M5S), as he sought to exploit his party’s popularity to force a snap election and seize the prime ministership. But Salvini, whose tactics have dented his popularity in recent weeks, had not banked on M5S teaming up with the Democratic party (PD).

After two weeks of negotiations, on Wednesday the prime minister, Giuseppe Conte, announced his team of ministers. The list includes Roberto Gualtieri, an influential PD member of the European parliament, as economy minister. The M5S leader, Luigi Di Maio, will be foreign minister. Luciana Lamorgese, a veteran of the interior ministry, in charge of planning refugee and migrant reception centres in northern Italy, has succeeded Salvini as interior minister.

Facebook Twitter Pinterest Italy’s president, Sergio Mattarella, and Conte (both centre) pose with members of the new cabinet. Photograph: Stefano Montesi - Corbis/Corbis via Getty Images

Many challenges lie ahead. On Tuesday, the parties published a 26-point programme intended to underpin the government. At the top of the list was a commitment to use the forthcoming budget to help to stimulate economic growth, but also a promise that it would not endanger public finances.

Italy has the second-largest debt burden in the EU as a proportion of economic output, and the pact called for greater flexibility from Brussels to overcome the “excessive rigidity” of existing budget rules.

Emphasising social justice, the two parties pledged to introduce a minimum salary, avoid a planned VAT sales rise and boost spending on education, research and welfare. The programme also called for a web tax on multinationals and the creation of a public bank to help boost development in the south.

The Eurosceptic League constantly railed against EU budget and migration rules, but the new EU affairs minister promised a more harmonious future. “The parties in this government will do their utmost not to quarrel with Brussels, not to have pointless fights or rows, but rather to put forward new ideas,” said Vincenzo Amendola, a member of the PD.

Dario Franceschini, a PD stalwart and the new culture minister, said: “We know very well that the parties which make up this coalition have had major clashes over the years. It is a difficult road ahead, but what matters is the spirit.”

Massimiliano Panarari, a political science professor at Luiss University in Rome, said of the coalition: “It is a government that is surely favoured by Brussels but in order to carry out its programme it will need to govern until 2022. So far, this seems very difficult.”

Others felt that the prospect of Salvini forming a far-right government with Brothers of Italy, a party with a neo-fascist lineage, would hold the new coalition together.

“I believe that the spectre of fresh elections with Salvini at 38% favourability in the polls helped to encourage this alliance,” said Franco Pavoncello, a professor of political science at John Cabot University in Rome. “Italy was brought to the edge with the preceding M5S/League government. Now there is an opportunity for a more reasoned politics.”

On Thursday Salvini was placed under investigation by prosecutors in Rome on suspicion of defaming Carola Rackete, the German captain of the NGO rescue ship Sea-Watch 3, who broke a naval blockade imposed by Salvini to bring rescued migrants to a port in Lampedusa.

The inquiry follows a complaint filed by Rackete in July. The captain asked authorities to close Salvini’s Facebook and Twitter accounts because they allegedly “stoked hate against her”.

As the new cabinet was sworn in, Salvini said “strong powers” within Europe were behind the new coalition. “It won’t last long,” he tweeted. “Opposition in parliament, in town halls and in the squares, then finally we will vote and win.”