An Italian court has ruled that three-time prime minister Silvio Berlusconi may run for office again, more than five years after he was banned for tax fraud.

However, three days ago the 81-year-old gave his blessing to the anti-migrant League party to form a government without him in the wake of an indecisive election result in Italy in March.

The League is in talks with the populist 5-Star Movement over forming a government, and is reportedly close to a deal – so the tribunal ruling could have come too late for him.

The Italian president, Sergio Mattarella, gave the two parties until tomorrow to reach a coalition deal and end the political impasse.

But Mr Mattarella has said that if political leaders cannot form a government soon, he will appoint a non-political premier to govern until the end of the year at the latest. That would then mean a fresh election and a chance for Mr Berlusconi to run again.

Milan daily newspaper Corriere della Sera reported that the tribunal overturned the ban on Mr Berlusconi’s running after reviewing a request from his lawyers.

In October 2012, the media mogul was found guilty of committing tax fraud as part of his vast business dealings. Italy's highest criminal court upheld his conviction the next year.

The conviction forced him to surrender his Senate seat and prevented him from being a candidate in national elections. He was allowed to do community service to replace most of his jail term, and he spent it helping Alzheimer's patients at a care home.

In pictures: Silvio Berlusconi's political career Show all 7 1 /7 In pictures: Silvio Berlusconi's political career In pictures: Silvio Berlusconi's political career 1994 The billionaire media tycoon wins elections with his Forza Italia (Go Italy) party, following a wave of anti-corruption investigations that decimate the old political order. He is forced to step down just months later after his coaltion partner pulls out. Getty In pictures: Silvio Berlusconi's political career 2001 Berlusconi wins elections for a second time after a powerful media campaign in which he promised to slash taxes and unemployment. He goes on to serve the longest stint as Prime Minister in Italy's post-war history Getty In pictures: Silvio Berlusconi's political career 2006 Berlusconi steps down after being narrowly defeated by a centre-left coalition led by Romano Prodi, right, a former president of the European Commission. Getty In pictures: Silvio Berlusconi's political career 2008 Mr Berlusconi wins a third election victory following the collapse of Mr Prodi's government due to internal disagreements over Italian troop deployments in Afghanistan Getty In pictures: Silvio Berlusconi's political career 2009 Veronica Lario, Silvio Berlusconi's wife, files for divorce and accuses her husband of cavorting with under age girls Getty In pictures: Silvio Berlusconi's political career 2011 Silvio Berlusconi steps down following a parliamentary revolt and a growing number of sex scandals and criminal investigations Getty In pictures: Silvio Berlusconi's political career 2013 Silvio Berlusconi is sentenced for having sex with a then under age 17-year-old prostitute nicknamed Ruby the Heart Stealer. He also loses a second and final appeal over a tax fraud conviction Getty

Chief prosecutor Roberto Alfonso said yesterday that prosecutors would decide within two weeks whether to appeal against yesterday’s tribunal decision.

The ban on the former prime minister seeking or holding public office was due to expire next year but the tribunal ruled that he already had been "rehabilitated", Corriere della Sera said.

"Silvio Berlusconi can finally return to the playing field," said Mara Carfagna, a leader of the Forza Italia party, which Berlusconi founded. "The 'rehabilitation' by the Milan surveillance court puts an end to a judicial persecution and a cavalry that didn't chip away at the strength of great leadership, that, in a profoundly changed political scenario, is today still fundamental and central."

The election on 4 March resulted in a legislature sharply divided into three factions, one of them the centre-right alliance of Forza Italia and the League party.