COLOMBO  - Sri Lanka's president has ordered the release of his jailed electoral foe, ex-army chief Sarath Fonseka, bowing to US-led pressure three years after the end of the island's long ethnic war.

The 61-year-old former four-star general could leave prison on Monday following legal formalities, an official said Sunday, after President Mahinda Rajapakse marked the third anniversary of the Tamil Tigers' crushing defeat.

Fonseka was arrested two weeks after he unsuccessfully challenged Rajapakse's re-election in January 2010. Since then, he had been incarcerated in military custody as well as jail for two years, three months and two weeks. The president signed the papers ordering Fonseka's release on Friday evening, spokesman Bandula Jayasekera said. "Papers will be sent to the Ministry of Justice on Monday," he said. Fonseka's wife Anoma Fonseka welcomed the decision.

"I welcome the announcement (of the release)," Anoma Fonseka told reporters outside a private hospital where prison authorities took her husband for treatment for a respiratory problem two weeks ago. "I hope the president will keep his promise to release him unconditionally," she said.

However, official sources said the pardon only cancels out the sentence and Fonseka may not have his civic rights to participate in elections for seven years from the time he walks out of jail.

The pardon also does not restore his title, medals and pension that were taken away by a military court on a charge of dabbling in politics while in uniform. The pardon does not extend to allegations that he employed army deserters as his bodyguards, a charge that carries a 20-year jail term. His passport has already been impounded.

Fonseka's Democratic National Alliance (DNA) party lawmaker and chief negotiator Tiran Alles said they will campaign for a full pardon.

Another DNA lawmaker, Jayantha Ketagoda, said Fonseka was keen to leave hospital and return to his cell to bid farewell to prison inmates.

"He is keen to go back to say his farewells," Ketagoda told reporters.

Fonseka is credited with leading the campaign that crushed the separatist Tamil Tiger rebels in May 2009, but also triggered international calls to probe the alleged deaths of up to 40,000 civilians in the war's final months.

The once feared former general, who also holds a US Green Card that grants him the right to reside there, was regarded by the United States as a political prisoner and Washington had repeatedly called for his release.

President Rajapakse issued the release order after his foreign minister, Gamini Lakshman Peiris, met in Washington on Friday with US Secretary of State Hillary Clinton for talks on the island's human rights record.

Clinton believed Sri Lanka has put forward "a very serious" plan for reconciliation after its civil war, and urged the government to move forward on protecting human rights, the State Department said.

Clinton also asked Sri Lanka to "de-militarise" the former war zone, but Rajapakse on Saturday insisted that there would be no troop withdrawal.

Fonseka fell out with Rajapakse over who should take credit for ending the savage ethnic bloodshed which killed up to 100,000 people between 1972 and 2009.

He had also angered the government by saying he would gladly testify before any international tribunal probing possible war crimes charges, after the UN said thousands of civilians were killed in the last months of fighting.

Fonseka was initially jailed for 30 months in September 2010 by a military court for corruption relating to military procurements.

In November 2011, he was sentenced to three more years in jail for saying that surrendering Tiger rebels had been killed on the orders of the president's brother Gotabhaya Rajapakse, who is the defence secretary.

Sri Lanka has denied that any civilians at all were killed by its troops at the climax of the war.