Rome(CNN) Italy's Prime Minister Giuseppe Conte resigned on Tuesday, effectively averting a no-confidence vote tabled by the far-right League party's leader Matteo Salvini.

In an hour-long speech at the Italian Senate on Tuesday afternoon, Conte launched a scathing attack on Salvini, the country's Deputy Prime Minister and Interior Minister, who is thought to be vying for his job.

Earlier this month, Salvini pushed for new elections, saying that the government coalition between the hardline anti-immigrant League party and the anti-establishment Five Star Movement no longer holds a majority in parliament.

Conte said Salvini's demand for fresh elections -- a mere 18 months after the last ones were held -- was "irresponsible" and accused him of putting the national interest at risk in order to advance his own personal interests.

"With a political crisis in mid-August, elections will probably be held in autumn and then this would mean a provisional government and will make us weak with our EU partners," Conte said.

Conte also slammed Salvini, who was sitting next to him throughout his speech, for what he described as a lack of statesmanship, and said his decision could bring about institutional and financial uncertainty.

"Asking citizens to vote every year is irresponsible," Conte added.

Conte listened to the rest of Tuesday's Senate debate before submitting his resignation to President Sergio Mattarella, potentially setting Italy off on a path towards the new elections Salvini has called for.

Mattarella will first hold "consultations," or, official meetings, with the speakers of the Senate and the representatives of all the other political parties on Wednesday.

Salvini took the microphone immediately after Conte finished his speech in the Senate, saying that he would "do what I did all over again," adding: "I am a free man. I am not afraid of the judgment of Italians."

He then said he wanted to offer Italians a "future of growth and prosperity."

Salvini also defended his policies on Europe and immigration, which caused the coalition to fall apart. He said: "are we or are we not a sovereign country, free to protect its borders, its beaches!"

At one point during his speech, Salvini took out a rosary and asked the Virgin Mary for protection for Italians. Conte has previously criticized Salvini's habit of showing the rosary during public speeches and rallies given his anti-immigrant policies.

A tenuous coalition

Conte, a law professor with no previous political experience, became prime minister in June 2018 after the League and Five Star Movement reached a coalition agreement.

The two populist, euroskeptic parties secured the most votes in the March 2018 election, but the coalition fell apart this month over disagreements on key policies.

Those disputes reached fever pitch this week, as the two parties engaged in a bitter political standoff over a migrant ship that has been stranded off Italy for 19 days.

Salvini refused to allow the Open Arms to dock, despite a court ruling that said the boat should be allowed to come ashore.

Conte, on the other hand, demanded that Salvini "urgently adopt the necessary measures to ensure assistance and protection for minors present in the boat."

Salvini eventually allowed 27 unaccompanied minors to disembark the ship — but insisted that the decision was "exclusively" Conte's responsibility.

Earlier in August, tensions between the two parties rose after a split vote over a planned high-speed rail link between Turin in Italy and Lyon in France, a project that the League favored.

The turmoil comes at a difficult time as Italy's parliament must approve and present its draft budget to European Union leaders in Brussels by mid-October.

Politicians are also working to finalize reforms proposed by the Five Star Movement which would slash the country's parliament by more than 300 seats.

Monday's rift may lead to an alternative coalition between the Five Star movement and the center-left opposition Democratic Party. Alternatively, the Five Star movement could reunite with the League for another coalition, under a different prime minister.