Sri Lanka's ex-army chief Sarath Fonseka leaves a private hospital in Colombo, ahead of being freed from prison.

Story highlights

NEW: Television footage shows Sarath Fonseka walking out of prison

A letter pardoning Fonseka has been sent to the prison authorities

He fell out of favor with President Rajapaksa after challenging him in elections

Colombo, Sri Lanka CNN  — 

Sarath Fonseka, the former head of the armed forces in Sri Lanka, was released from prison Monday.

A military court-martial in 2010 sentenced him to 30 months in jail for irregular procurements during his time in charge of the army. A previous court-martial had stripped him of his title of general and deprived him of his pension for “dabbling in politics.”

Television footage showed Fonseka walking out of prison Monday after Justice Secretary Kamalini de Silva sent paperwork to prison authorities ordering his release.

Under the Sri Lankan constitution, the president is empowered to pardon “any offender convicted of any offense in any court of Sri Lanka.”

President Mahinda Rajapaksa had signed an order and placed it with the Justice Ministry before he flew to Doha to attend the Qatar Forum, according to his spokesperson Bandula Jayasekera.

“I can’t believe it. This was quite unexpected,” said Fonseka’s wife, Anoma. “My two daughters have arrived from the U.S. and we are very pleased with the release of my husband and their father.”

Fonseka, who led troops to victory over Tamil Tiger rebels exactly three years ago this week, had fallen out of favor with Rajapaksa and his powerful brother, Defense Secretary Gotabhaya Rajapaksa.

That split came after Fonseka unsuccessfully challenged Rajapaksa in early 2010 presidential elections.

Last year, Fonseka was found guilty of “inciting violence” for alleging in a newspaper interview that Gotabhaya Rajapaksa had ordered the shooting of rebel leaders who were surrendering with white flags during the final stages of the civil war in May 2009.

The United States labeled Fonseka a “political prisoner” in its annual Human Rights Report last year. Both Washington and the European Union have repeatedly called for his release.

The formalities necessary to clear the way for Rajapaksa’s pardon were addressed Monday when the Supreme Court allowed an application by Fonseka’s counsel to withdraw two different appeals against his previous convictions.

Fonseka was driven from the private Nawaloka Hospital to the court by an armed group of prison guards. He had been in hospital for a lung ailment for the past 25 days, according to hospital officials.

Large crowds carrying the national flag, portraits of Fonseka gathered outside the hospital.

Asked whether her husband would reenter politics, Anoma Fonseka enigmatically replied, “It depends.”