But even in the hours before his resignation, Renzi was seeking to pave a path however uncertain for his eventual return.

In a note posted on his website, and in a highly anticipated speech before lawmakers in his Democratic party (PD), Renzi finally offered a plan for how he believed the party should move forward. He called on opposition parties to join the PD to form a new government that would tackle the countrys challenges and international obligations.

Other parties have to share the burden, he said, adding that it would be difficult to sustain a situation in which the PD was depicted in the media every day and every night as a government that had not legitimately been elected, a frequent criticism of Renzis government after he entered office following an intra-party coup.

If they failed to agree, Renzi said, new elections should be called as soon as the countrys constitutional court issued its verdict on an electoral law that is under review and may need to be changed. The verdict is due 24 January.

The Democratic party is not afraid of democracy. The Democratic party is not afraid of votes, he said.

It was unclear until Wednesday afternoon when Renzi would actually leave the prime ministers office. But, an avid fan of social media, he confirmed his official resignation on Twitter after the budget passed, writing: Formal resignation at 7pm. Thanks to all and long live Italy.

His departure was set in motion when it became clear that nearly 60% of Italians had voted to reject the sweeping changes to Italys constitution and parliamentary system that were backed by the outgoing prime minister. The resounding defeat was not only seen as a rejection of the reforms, but as a vote of no confidence in Renzi, who said he would step down if the vote went against him.

The formal resignation will free Mattarella, who has the power to dissolve parliament and name prime ministers, to begin talks with the leaders of Italys biggest political parties including the PD, conservative Forza Italia, the anti-establishment Five Star Movement, and the anti-immigrant Northern League who will have to agree on an interim government and prime minister.

Renzi also announced that he would not personally be involved in the negotiations.

He suggested one of his two deputies be sent to the talks with Mattarella: Lorenzo Guerini or Matteo Orfini, and two whips, Ettore Rosato and Luigi Zanda.

If no agreement can be reached, the new interim prime minister could probably be installed just with the backing of the PD, which controls a majority of seats in parliament. But as Renzi suggested, the party would then want elections to be called as soon possible.

One of the biggest questions is whether Renzi can still command the loyalty of a majority of his party after Sundays rout.

Meanwhile, the interim government, likely to be installed in the next few days if an agreement can be reached, is expected to deal with the primary task of amending an electoral law that needs to be changed following the referendum.

Giovanni Orsina, a professor of Italian politics at LUISS University in Rome, said the biggest question now was whether the developments of the next few days would go according to Renzis wishes and demands.

If Renzi got his way, Orsina said, the interim prime minister would be someone he trusts to stay in office until the electoral law is amended someone who would then resign to open the door to elections.

Renzis preferred candidates for the job are widely believed to be Pier Carlo Padoan, his finance minister, Paolo Gentiloni, his foreign minister, or Graziano Delrio, the infrastructure minister.

Orsina added: The real issue is, are we going to have a government that Renzi controls to the extent that he may ask the prime minister to resign in the right moment? Or will he have to accept a prime minister that is not under his full control?