COLOMBO, Sri Lanka (AP) — A military court convicted former Sri Lankan army chief and presidential candidate Gen. Sarath Fonseka of involvement in politics while in service and stripped him of his rank and military honors, the government announced Friday.

Fonseka led Sri Lanka's army in its victory last year against ethnic Tamil rebels, ending a quarter-century civil war that killed an estimated 80,000 to 100,000 people.

One-time allies, Fonseka and President Mahinda Rajapaksa were both considered heroes by Sri Lanka's Sinhalese majority for crushing the Tamil Tigers, however, their relationship deteriorated after hostilities ended.

Fonseka's sentence of a dishonorable discharge was subject to Rajapaksa's approval, the media office of the presidency said Friday. No immediate comment was available from the government.

Fonseka's lawyer, Rienzie Arsecularatne, denounced the verdict and said the case was heard in his absence during a court vacation. He said he would appeal the decision.

"They went ahead and fixed the court-martial on the days I was not available," Arsecularatne said. "This is not a proper trial. This is a total miscarriage of justice."

Rajapaksa and Fonseka had a falling out months after the war ended and the general quit the army after accusing Rajapaksa of sidelining him, suspecting a military coup.

Fonseka ran unsuccessfully for the presidency against Rajapaksa in January and was arrested weeks after, accused of planning his political career while still in uniform and breaching regulations in purchasing military hardware.

Fonseka has been detained ever since. His supporters called the charges baseless and accused Rajapaksa of persecuting the general for daring to challenge him at the polls.

Political analyst Jehan Perera said the verdict by the military judges effectively left Fonseka's fate in Rajapaksa's hands. "It appears they are leaving the final decision to the president to make a political decision," he said.

Fonseka also faces a second court-martial on alleged corrupt deals while in the army. It was unclear when the verdict on that will be announced.

If found guilty on the second count, Fonseka could face a jail term of three months to five years, a military officer said on condition of anonymity, citing the sensitivity of the case.

Friday's verdict stripped Fonseka of his general rank, medals, and other military honors he received on the battlefield.

Government officials initially accused Fonseka of plotting to assassinate Rajapaksa and capture power, but those allegations were not among the official charges.

While in detention, Fonseka contested parliamentary elections in April with the opposition Democratic National Alliance and won a seat, while Rajapaksa's party won a majority.

When the court-martial began in March, Fonseka pleaded not guilty and questioned the impartiality of the judges. The panel dismissed his accusation.

U.N. Secretary-General Ban Ki-moon in June appointed a three-member panel to advise him on ensuring accountability for alleged abuses during Sri Lanka's war. The Sri Lankan government has opposed the panel.

The United Nations says at least 7,000 civilians were killed in the last five months before the war ended in May 2009 when government forces finally crushed the ethnic Tamil rebels. The Tigers had fought for an independent state for a quarter-century, after decades of discrimination by the Sinhalese majority.

The U.N. says between 80,000 and 100,000 people were killed during the 25-year war.