* Vote against leftist Lula would likely end his political career
* Supreme Court case casts shadow over October election
* Brazil deeply divided after President Rousseff's 2016 removal (Raises context on political consequences of decision against Lula)
BRASILIA, April 4 (Reuters) - Brazil's Supreme Court justices were on the verge of rejecting former leftist president Luiz Inacio Lula da Silva's plea to avoid prison while he appeals a corruption conviction, in a vote that would likely end his political career and deepen divisions in the country.
A pivotal vote was cast late Wednesday by Justice Rosa Weber against Lula's request to avoid jail and begin serving his 12-year sentence for accepting bribes. Weber was seen as a swing vote, and her decision likely means a majority will rule the same way.
Lula is still Brazil's most popular politician, despite his conviction and six separate pending corruption trials. He is the front-runner in all opinion polling for the election in October, though his conviction will likely bar him from running.
A decision against Lula would be a serious blow to the political survival of Brazil's first working-class president whose career from a factory shop floor to high office is sinking in the corruption scandals that have rocked the political establishment and especially his Workers Party, which held power from 2003 until mid-2016.
Brazilian society remains deeply divided after Lula's successor, President Dilma Rousseff, was impeached and removed from office amid a corruption scandal and economic crisis.
Lula's conviction was upheld on a first appeal. Under Brazilian electoral law, a candidate is forbidden from running for elected office for eight years after being found guilty of a crime. Some exemptions have been made in the past, and the ultimate decision in Lula's case would be made by the top electoral court if and when Lula official files to be a candidate.
The final result of the high court vote could be delayed until Thursday, or put off indefinitely if any remaining six justices request more time to make a decision.
Lower court judges, the country's top prosecutor and business groups have urged the court to abide by its own 2016 ruling that defendants can be jailed if a conviction is upheld on a first appeal, as Lula's was earlier this year.
Before that ruling, appeals in Brazil's complex and badly backlogged legal system could stretched out for several years, guaranteeing impunity for those rich enough to afford lawyers who could launch countless technical appeals.
MILITARY WEIGHS IN
Tensions increased on Tuesday when the commander of Brazil's army weighed in with tweets calling on the court to stand guard against impunity. That rattled nerves across Brazil, which endured a 1964-85 military dictatorships and has a long history of coups interrupting democratic regimes.
General Eduardo Villas Boas wrote that the army along with "all good citizens, repudiates impunity and respects the Constitution, social peace and democracy."
Villas Boas wrote that the army would stick to its constitutional role. But retired officers have warned that the military would not take lightly to the Supreme Court, which has rejected nearly all similar appeals in the past two years, ruling that Lula could remain free on appeal.
Army reserve general Luiz Lessa told the Estado de S.Paulo newspaper on Tuesday the military would have to intervene if Lula was allowed to become a candidate in the election. The army said that was his personal opinion.
Lula oversaw years of robust growth and falling inequality during a commodity boom and has said he wants to run again for the presidency in October.
His supporters see the conviction as a ploy to stop him returning to power. The Workers Party said the Army commander's comments widely reported by Brazilian media had brought undue pressure to bear on the Supreme Court to rule against him.
Lula was found guilty in August and sentenced to 10 years in prison for accepting bribes worth 3.7 million reais ($1 million) from engineering firm OAS, the amount of money prosecutors said OAS spent refurbishing a beach apartment for Lula in return for his help winning contracts with state-run oil company Petroleo Brasileiro.
In January, an appeals court unanimously upheld his conviction and increased the prison sentence to 12 years. (Reporting by Anthony Boadle; Additional reporting by Brad Brooks in Sao Paulo; Editing by Rosalba O'Brien and Grant McCool)