COLOMBO, Sri Lanka (AP) — Sri Lanka's ex-army chief called the government a "total dictatorship" and said Thursday that he will appeal his recent conviction by a military court, which he described as a political vendetta.

Former Gen. Sarath Fonseka said the inquiry on charges he was involved in politics while still in the military was launched to persecute him for daring to challenge President Mahinda Rajapaksa in the presidential election earlier this year.

He criticized the Rajapaksa regime for harassing political opponents, saying a "lawlessness" prevails in the country while "a total dictatorship is going on."

A military court ruling last week recommended Fonseka be dishonorably discharged and stripped of his rank, pension, medals and other military honors. The president approved and carried out the dismissal on Saturday.

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

One-time allies, the president and Fonseka were both considered heroes by the Sinhalese majority for crushing the Tamil rebels.

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. Their relationship further deteriorated after Fonseka challenged Rajapaksa in the presidential election.

Fonseka lost the election to Rajapaksa in January and was arrested weeks later. He was accused of planning his political career while still in uniform and breaching regulations for purchasing military hardware. Fonseka has been detained since then.

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.

On Thursday, Fonseka met reporters at parliament and said he would appeal against the court martial verdict, though he has no "confidence and faith" in the legal system.

He said if he does not appeal, the government would see it as an admission of guilt.

"We will put everything on record by doing that. Otherwise, they will find it as an excuse to say that these people were guilty so they didn't defend themselves."

He also expressed fears that he would be sent to jail after a second court martial in which he faces charges for allegedly making corrupt deals while in the army. It was unclear when that verdict will be announced.

He could face three months to five years in jail, a military officer said on condition of anonymity, citing the sensitivity of the case.

In June, U.N. Secretary-General Ban Ki-moon 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. The Tigers had fought for an independent Tamil state after decades of discrimination by the Sinhalese majority.