Sri Lanka's president Thursday secured cabinet approval to free jailed former army chief and defeated opposition presidential candidate Sarath Fonseka, a senior official said.
President Mahinda Rajapakse's spokesman said he "got approval from the cabinet of ministers to release" the former four-star general, but did not give further details.
Fonseka's wife Anoma said earlier she met the president on Wednesday night and he assured her her husband would be freed as soon as possible.
"I was promised that my husband will be cleared of all charges and released unconditionally," she said.
An official from the attorney general's department said they were trying to iron out legal snags that would allow Fonseka to be released on a presidential pardon.
The official said Fonseka, who unsuccessfully challenged Rajapakse in January 2010 elections, could be released "within days".
Fonseka fell out with the government over who should take credit for winning the separatist war against the Tamil Tiger rebels in May 2009. He challenged Rajapakse after quitting the army.
Two weeks after his election defeat, Fonseka was detained on a charge of corruption relating to military procurements. He was given a 30-month jail sentence in September 2010.
He is due to go before a Colombo judge on Friday in connection with another case in which he is charged with harbouring military deserters as his body guards after he quit the army.
Earlier Wednesday, Rajapakse met members of Fonseka's Democratic National Alliance (DNA) party to discuss the terms of his release, DNA legislator Tiran Alles told reporters.
The moves come ahead of talks later this week between Sri Lanka's Foreign Minister G. L. Peiris and US Secretary of State Hillary Clinton in Washington.
The United States has been critical of Sri Lanka's rights record during the final stages of the civil war, which ended with victory for government forces in May 2009. Washington has repeatedly urged Colombo to release Fonseka.
In November, Fonseka was sentenced to three more years in jail for saying Tiger rebels who surrendered had been killed on the orders of the president's brother Gotabhaya Rajapakse, who is defence secretary.
Fonseka has also angered the government by saying he would testify before any international tribunal probing possible war crimes charges after the United Nations said thousands of civilians were killed in the last months of fighting.