Brazil’s Supreme Federal Tribunal (STF) ruled early Thursday morning against a habeas corpus petition that would have kept socialist former president and presidential frontrunner Luiz Inácio Lula da Silva from beginning to serve a 12-year prison sentence for corruption.

The decision does not prevent Lula, as he is popularly known, from attempting to register on October’s presidential ballot but would mean that the Workers’ Party (PT) candidate would have to campaign from prison. He is still ineligible to serve as president as per the nation’s “Clean Slate” law, which prevents individuals convicted on corruption charges from serving in public office. To assume the presidency, he would have to challenge the law before the STF.

The STF is comprised of 11 members. Five voted in favor of granting the habeas corpus petition, which would have kept Lula from beginning to serve a prison sentence until he had exhausted all his appeals. Six voted in favor of forcing him to begin serving his prison sentence. Lula has already lost an appeal on his sentence. Appellate judges not only denied his appeal but extended his sentence from nine years to 12 in prison.

Carmen Lúcia, the president of the STF, broke a 5-5 tie shortly after midnight local time to reject the habeas corpus petition after the court denied the defense’s request to keep her from voting. Lúcia noted that she had already ruled that forcing someone convicted of a crime who had not exhausted all appeals to begin serving their sentence did not damage the presumption of innocence in cases dating as far back as 2009.

The former socialist Workers’ Party (PT) president was convicted of corruption and money laundering last year as part of a larger investigation known as “Operation Car Wash.” Brazilian prosecutors have uncovered an extensive corruption scheme in which dozens of the nation’s most prominent politicians were accepting kickbacks from corporate firms, including the disgraced construction firm Odebrecht, in exchange for overpriced infrastructure project contracts. The firms would give back part of the excess taxpayers’ funding the contracts provided to the politicians to secure further business.

Brazilian courts found that Lula accepted over one million dollars in bribes and used part of the funding for a luxury beachfront property. The former president, who ran a campaign championing the rights of the poor and continues to do so in seeking a second term as president, initially received a sentence of fewer than ten years in prison, amended on appeal.

Yet he remains the presidential frontrunner; most polls show him with a comfortable lead over his main rival, the conservative lawmaker Jair Bolsonaro. A national poll released in February found that one in four Brazilians were not aware that Lula had been convicted of a crime. It is not yet clear how Lula’s supporters would vote if not offered his name on the ballot, and the PT has insisted it has no “Plan B” to replace Lula as its candidate.

Adding to the drama Wednesday morning were remarks on Twitter from the head of Brazil’s military, General Eduardo Villas Bôas, who wrote that the nation’s armed services “are willing to share the desire of all good citizens for the rejection of impunity.” Villas Bôas added that the military would “keep a close eye on its institutional mission,” a remark that alarmed many on Brazil’s left and sparked concerns of a coup in the event that Lula overcame his prison sentence and was elected president once more.

The PT issued an official statement asserting, “it is not natural in a democracy for military leaders to make public statements on political or legal matters, as has happened during the past few days,” and condemning the broadcaster TV Globo for informing their audience on the remarks of the general. Glenn Greenwald, the American journalist who has lived in Brazil for over a decade and opposed the imprisonment of Lula, declared that “it’s not an exaggeration to say the military coup began.”

7/ Last night, it’s not an exaggeration to say the military coup began. The commanding General, @Gen_VillasBoas, posted two tweets – obviously referring to today's court ruling – warning that “the Brazilian army” is committed to “repudiating impunity” for crimes. pic.twitter.com/2HtTS0wH16 — Glenn Greenwald (@ggreenwald) April 4, 2018

Brazil is sensitive to concerns of such a coup. The military overthrew its government in 1964 and established an armed forces dictatorship that lasted through 1985, responsible for a host of human rights abuses against its opponents. Supporters of the military regime argue that it was necessary in light of attempts by communist insurgents to take over the government during the Cold War, particularly in the context of the Cuban Revolution.

Bolsonaro, himself a military veteran who has made remarks that appear supportive of the military regime, tweeted in defense of Villas Bôas.

“The party of the military is Brazil. Men and women in green serve the nation. Their commander is a soldier at the service of democracy and liberty. That is how it was in the past and will always be. With pride: ‘We are united General Villas Bôas,'” Bolsonaro wrote on Twitter.

O partido do Exército é o Brasil. Homens e mulheres, de verde, servem à Pátria. Seu Comandante é um Soldado a serviço da Democracia e da Liberdade. Assim foi no passado e sempre será. Com orgulho: "Estamos juntos General Villas Boas." Jair Bolsonaro / Capitão / Deputado Federal. — Jair M. Bolsonaro (@jairbolsonaro) April 4, 2018

Acting Minister of Defense General Joaquim Silva e Luna also issued a statement supporting the general. “General Villas Bôas has shown consistency … The message is that the population can stay calm because the institutions are here. It is not a message of use of force,” he said.

Protests in favor and against the STF decision are expected throughout Brazil on Thursday.

Follow Frances Martel on Facebook and Twitter.