Luiz Inacio 'Lula' da Silva - a leftist leader who rose from abject poverty to serve as Brazil's president from 2003 to 2010 - was widely tipped to win the country's general election scheduled to be held in October.

However, a ruling by the country's supreme court early on Thursday will almost certainly see him soon jailed on corruption charges.

Once called "the most popular politician on Earth" by Barack Obama, the former US president, Lula da Silva was sentenced to nine years and six months in prison last year after being accused of receiving more than $1m in bribes from construction giant OAS.

An appeals court in January upheld corruption and money-laundering convictions against the 72-year-old. His sentence was extended to 12 years and he was barred from running.

Lula unsuccessfully applied to the Supreme Court for habeas corpus, hoping they would allow him to remain out of prison during his appeals against the decision. He is now expected to be imprisoned within days, leaving Brazilians divided.

Several of Brazil's elite have been ensnared by Operation Car Wash, a huge investigation into a bribes-and-kickbacks network that has shaken the country's political establishment and cost it more than $40bn.

Led by a small group of idealistic, young Brazilian prosecutors and a crusading judge, the investigation has exposed a vast international web of corruption involving business leaders and their efforts to bribe politicians to win contracts.

Lula da Silva and his lawyers maintain he is innocent.

"I have peace of mind," he said in a 2016 Talk to Al Jazeera interview.

"I doubt any prosecutor or police delegate in this country is more honest or more ethical than me."

Lifted millions out of poverty

The former trade union leader turned president is hugely popular in Brazil after overseeing a period of sustained growth that saw millions lifted out of poverty during his presidency between 2003 and 2010.

Under his leadership, the value of Brazil's currency more than doubled against the US dollar, unemployment was at a record low, and illiteracy dropped.

However, in 2016, his protege and successor, Dilma Rousseff, was impeached after being accused of manipulating federal budgets.

{articleGUID}

Rousseff denied any wrongdoing and described efforts to remove her as a coup. Still, she was stripped of the presidency in August following her impeachment and was replaced by Michel Temer.

But after Temer, the sitting president, was charged with taking bribes, Lula da Silva was widely expected to return to office should he stand in October's elections.

He currently leads opinion polls by a significant margin, while Temer has had a single-digit approval rating for months.

The judge leading the charge, Sergio Moro, is viewed by many Brazilians as a superstar anti-corruption crusader, but others see him as a man on a mission to destroy Lula da Silva.

Lula da Silva's ascent to the presidency in a country with one of the world's biggest wealth gaps was heralded as a success story of Brazil, and he remains the only president to leave office with high approval ratings.