President Sergio Mattarella met the leaders of the major political parties on Wednesday in an attempt to find a solution to the political crisis.

The M5S and the PD now look set to form a new coalition, despite having been bitter enemies until just a few weeks ago.

The M5S has since June this year been part of a populist coalition with the far-right League, but that government collapsed last week when League leader Matteo Salvini called for snap elections.

PD leader Nicola Zingaretti on Wednesday told Mattarella his party was prepared to govern with the M5S, and to accept the anti-establishment group’s proposed prime minister, Giuseppe Conte.

“We love Italy and we consider it worthwhile to try this experience,” Zingaretti told reporters.

Speaking shortly afterwards, Di Maio said: “We made commitments to the Italians...and come what may we want to fulfil them.”

The parties had earlier disagreed over whether Conte, the outgoing prime minister, should lead a new coalition.

While they seem to have resolved this issue, the two sides still need to agree on a shared policy platform and team of ministers.

Unexpectedly, M5S founder Beppe Grillo issued a statement late on Wednesday saying the ministers should be technocrats and not elected politicians – a suggestion that is unlikely to gain traction with the PD.

In an added complication, the M5S has said it will put any deal with the PD to an online vote of its members.

Many M5S supporters have taken to social media to denounce a pact with the centre-left and a “yes” vote cannot be taken for granted.