An ex-metalworker who became one of Brazil's most popular presidents, Luiz Inacio Lula da Silva fell spectacularly from grace when he was jailed for corruption, but could now make a political comeback after a judge overturned his convictions.

Monday's ruling by Supreme Court Justice Edson Fachin restores the 75-year-old leftist icon's right to run for office -- potentially just in time for a showdown against his nemesis, far-right President Jair Bolsonaro, in elections next year.

Known for his charisma and common man's touch, Lula left office on January 1, 2011 as a blue-collar hero who presided over a watershed boom and helped lift tens of millions of people out of poverty.

But he has been embroiled in a massive corruption scandal that has engulfed some of Brazil's most influential politicians and business executives.

Lula was jailed in 2018 -- sidelining him from the race that brought Bolsonaro to power -- and spent more than 18 months in prison before being freed pending appeal.

In a procedural decision, Fachin ruled that the court that convicted Lula lacked jurisdiction, and sent four cases against him to another federal court, in Brasilia.

The ruling landed like a bomb just as Brazil gears up for the October 2022 elections, for which a recent poll gave Lula the most likely votes -- the only politician to outperform Bolsonaro.

Brazil's first democratically elected leftist, Lula enjoyed widespread popularity, as a booming economy during a period of high commodity prices helped him ride out numerous corruption scandals.

He presided over a so-called golden decade for Latin America, when a rising China's ravenous demand for raw materials propelled regional economies to record growth.

Lula also helped secure for Brazil the world's two biggest sporting events -- the World Cup in 2014 and the 2016 Olympic Games in Rio de Janeiro.

He was called "the most popular politician on Earth" by no less than Barack Obama, and stepped down after two terms basking in 80 percent popularity ratings.

Brazil's former president Luiz Inacio Lula da Silva, seen in a file photo taken on April 07, 2018, is expected to be freed from prison following a ruling by the country's Supreme Court
Brazil's former president Luiz Inacio Lula da Silva, seen in a file photo taken on April 07, 2018, is expected to be freed from prison following a ruling by the country's Supreme Court AFP / NELSON ALMEIDA

But his image has been tarnished by numerous corruption charges.

Lula was sentenced to a total of 26 years in jail on charges of accepting a triplex beach apartment and renovations at a ranch property as bribes for greasing companies' access to juicy contracts with state oil giant Petrobras.

He will still face those charges, as well as several other corruption and influence peddling cases.

He denies all the accusations, arguing they were politically motivated.

Lula grew up in deep poverty, the seventh of eight children born to a family of illiterate farmers in the arid northeastern state of Pernambuco.

When he was seven, his family joined a wave of migration to the industrial heartland of Sao Paulo state, where Lula worked as a shoeshine boy and peanut vendor on the street before becoming a steelworker.

In the 1960s he lost the little finger of his left hand in a workplace accident.

He rose quickly to become president of his trade union, and was the force behind major strikes in the 1970s that challenged the military dictatorship then in power.

In 1980, he co-founded the Workers' Party, first standing as its candidate for president nine years later.

Lula made three unsuccessful presidential bids, from 1989 to 1998, each time chipping away at the establishment parties and the idea that a poor, uneducated labor leader could never be president of Brazil.

The fourth time, in 2002, he succeeded, taking office on January 1, 2003.