Sri Lanka's cabinet has formally backed President Mahinda Rajapaksa's move to free his ailing former army chief Sarath Fonseka, a spokesperson says.
Rajapaksa will order the release of his jailed rival this week, sources close to him had told Reuters news agency earlier on Thursday.
Sarath Fonseka, a former general revered as a hero by many for helping end the 25-year civil war against the Tamil Tiger rebels, was detained in February 2010 after challenging Rajapaksa for president and was later stripped of his rank.
"President got the approval of the cabinet of ministers to release Sarath Fonseka," Rajapaksa's spokesperson, Bandula Jayasekara, said. He declined to give a date and whether any conditions were attached to the release.
The high court granted an application for bail on Friday, paving the way for Rajapaksa to either pardon him or commute the sentence.
Commentators expect Fonseka to be released on Saturday, coinciding with Sri Lanka's Victory Day.
Fonseka leads the Democratic National Alliance, which has seven seats in a 225-member legislature. Some legislators from other opposition parties have said they are ready to back him due to his popularity and outspoken criticism against Rajapaksa.
He trailed Rajapaksa by 17 points in the last presidential election and with the next one not due until 2016, he is not seen as an immediate political threat. His health has deteriorated in prison, increasing pressure on Rajapaksa to release him.
Economic woes pushing up the cost of living have dented the government's popularity ahead of local elections this year, and some analysts see Rajapaksa's decision to release his rival as a move to increase his party's chances by dividing the bickering opposition.
Fonseka is being treated in hospital for respiratory problems arising from a 2006 assassination attempt by a Tamil Tiger suicide bomber.
His wife said she met Rajapaksa on Wednesday and he informed her of the pending release.
"The president said the general will be released unconditionally," Anoma Fonseka said. "The president told me that he will be releasing the general very soon and wanted the pending issues to be sorted out."
A government source said Rajapaksa was most likely to make the announcement on or before Saturday when Sri Lanka holds a military parade to mark the 2009 defeat of the separatist Tamil Tiger rebels.
The US has long called for the release of Fonseka, whom it calls a political prisoner. The timing of the planned release coincides with a visit by Sri Lanka's foreign minister to Washington, where he was to meet Hillary Clinton, the US secretary of state, on Friday.
Fonseka and Rajapksa's brother, the defence secretary Gotabaya Rajapaksa, led the army to victory in the final stages of the war, but they fell out after the war ended. The general complained he was sidelined by the president, who grew concerned Fonseka was plotting a coup.
The career infantry officer was prosecuted for an interview he gave to the Sunday Leader newspaper in December 2009 in which he said he was informed that Gotabaya Rajapaksa ordered troops to kill surrendering rebel leaders.
A US-backed resolution at the UN Human Rights Council last month urged Sri Lanka to investigate alleged abuses during the last months of the war.
Rights groups say both the former army chief and the president are implicated in shooting fighters as they sought to surrender. In recent months, rights workers and journalists have been targeted by a government media campaign against "traitors" it says helped the defeated guerrillas.