Italy's parties Saturday voted overwhelmingly for outgoing President Sergio Mattarella to remain for another term, averting the political chaos that a failure to elect his successor could have sparked in the eurozone's third-largest economy.

Electing the 80-year-old ended weeks of hand-wringing over whether prized Prime Minister Mario Draghi should be elevated, with many fearing such a move would have left the government rudderless at a highly sensitive time.

Mattarella needed at least 505 votes from an electoral college of 1,009 lawmakers and regional representatives. He won 759, earning another stint as president in spite of himself.

The former constitutional court judge had repeatedly ruled out serving a second term, but gave in Saturday after Italy's bickering political parties failed to find another viable candidate.

"I had other plans, but if it's necessary, I'm available," Mattarella said before the vote, according to party parliamentary representatives.

He was expected to be sworn in on Wednesday or Thursday. Although many expect him to leave before the end of his new seven-year term, he is likely to stay at least past elections scheduled for 2023.

Italy's presidency is largely ceremonial, but the head of state wields serious power during political crises, from dissolving parliament to picking new prime ministers and denying mandates to fragile coalitions.

Draghi said the result, after eight rounds of voting over six days, was "wonderful news for Italians".

French President Emmanuel Macron tweeted his congratulations to "dear Sergio", while German President Frank-Walter Steinmeier hailed a "role model" who "understands the importance of Europe".

Pope Francis hailed Mattarella's "generous" agreement to stay on during a period of uncertainty caused by the coronavirus pandemic, which hit Italy hard.

Draghi, a former European Central Bank chief brought in to lead a national unity government almost a year ago, had been touted for months as the most eligible head of state.

But many feared his departure as prime minister would destabilise debt-laden Italy as it recovers from a lockdown-induced recession.

Italian President Sergio Mattarella has  served a tumultuous seven-year term but is a unifying figure
Italian President Sergio Mattarella has served a tumultuous seven-year term but is a unifying figure Quirinale Press Office via AFP / Handout

Italy is banking on almost 200 billion euros ($222 billion) in EU funds to cement the trend, but the money from Brussels is dependent on a tight timetable of reforms.

International investors have been watching the election closely, amid fears Draghi's exit could undermine the whole programme.

Guido Cozzi, professor of macroeconomics at the University of St. Gallen, told AFP an extension of Mattarella's mandate was "ideal for the financial markets".

Draghi has also managed to keep to a minimum squabbling between Italy's parties, almost all of which share power in his national unity government.

But the Repubblica daily pointed out that, with the campaign for the 2023 election already underway, the year ahead "risks being a replay of the shambles we've seen over the past few days".

It will now fall to Mattarella to keep the peace: "a task more difficult than we can imagine".

Matteo Salvini, head of the far-right League party, was the first to openly propose the popular outgoing president Saturday, after putting forward a candidate Friday that flopped.

Billionaire former premier Silvio Berlusconi, who took a failed shot at the presidency himself, also said his party would ask Mattarella "to make a big sacrifice", as did the centre-left Democratic Party (PD).

Only the far-right Brothers of Italy party was against asking him to stay on.

A double mandate is not entirely unprecedented.

In 2013, president Giorgio Napolitano was re-elected in an attempt to resolve the political stalemate left by an inconclusive general election. He served nearly two more years.

Mattarella was little-known to the public when elected president in 2015, known mostly for his brother's murder by the mafia in 1980, and for taking a stand as a minister against Berlusconi.

But the Sicilian has inspired respect and affection across the political sphere, seeking to be a unifying figure through five different governments.