Updated at 8:40 p.m. ET

A judge has issued an arrest warrant for Brazil's former President Luiz Inácio Lula da Silva, who will wait in prison while he appeals a corruption conviction. The country's highest court ruled early Thursday that he could not remain free during the appeal process.

In a 6-5 decision, the Supreme Federal Tribunal rejected da Silva's request to remain free while he appeals a 12-year prison sentence for corruption.

The 72-year-old leftist politician who served as the country's president between 2003 and 2011 had his sights set on winning back the office in the election in October, a prospect now very remote despite his lead in opinion polls.

Lula, as he is known, has said the case against him is politically motivated and designed to keep him from running. Many Brazilians still see the former leader as a champion of the poor.

"The Brazilian people have the right to vote for Lula, the candidate of hope," Lula's Workers' Party wrote on Twitter after the announcement, according to an Associated Press translation. "The PT [Workers' Party] will defend this candidacy on the streets and in every court until the last consequences."

"There is no justice in this decision," the group wrote in another tweet.

Lula was convicted in July of corruption and money laundering and sentenced to 9 1/2 years in prison. "Judge Sérgio Moro found the popular politician guilty of illegally taking more than $1 million in kickbacks from an engineering company, using the money to refurbish a beachfront apartment," NPR's Colin Dwyer reported at the time.

A three-judge appeals panel then upheld that conviction in January — and increased Lula's sentence to 12 years.

A sprawling corruption investigation involving the state-run oil company Petrobras, dubbed Operation Car Wash, "has ensnared many of the country's politicians and business figures in high-profile allegations," as The Two-Way reported, including the current conservative president, Michel Temer, and executives at the meatpacking company JBS.

Copyright 2018 NPR. To see more, visit http://www.npr.org/.