Image copyright AFP Image caption Former army chief Sarath Fonseka campaigned against Mahinda Rajapaksa in elections earlier this month

The new Sri Lankan government has removed punishments imposed on controversial war-time army chief Sarath Fonseka by the previous regime.

Mr Fonseka has been reinstated as an army general and his right to vote and stand in elections has been restored.

His rights were removed after he was jailed for corruption and other crimes.

Mr Fonseka and former President Mahinda Rajapaksa oversaw a military campaign against Tamil rebels in which thousands of civilians are said to have died.

The two men later fell out and Mr Fonseka stood against his former ally in the 2010 presidential election.

He was jailed shortly afterwards and deprived of his political rights.

The former army chief had already been pardoned and freed by Mr Rajapaksa.

But correspondents say the move by new President Maithripala Sirisena amounts to a quashing of his previous convictions.

Sources told the BBC that a corruption case against him has also been dropped, and he has discontinued an appeal against his convictions.

Analysis: Charles Haviland, former Sri Lanka correspondent, BBC News

Sarath Fonseka is one of the most divisive figures in Sri Lankan politics. He led the army to victory over the Tamil Tigers in a campaign controversial for its large number of civilian casualties.

He has denied allegations contained in a UN-commissioned report that tens of thousands of civilian Tamils were killed.

But, speaking to the BBC in 2012, he said Sri Lanka must co-operate with any international investigation into war crimes allegations. Such statements had him branded as a "traitor" by the previous Rajapaksa government.

Whether he will adopt the same stance under the apparent new order in Colombo remains to be seen.

The new president, Maithripala Sirisena, who is strongly backed by Mr Fonseka, disowned Mr Rajapaksa but vowed not to allow him to be hauled before an international war crimes court.

The Rajapaksa government also refused to allow a team of UN-mandated war crimes investigators into the country. It seems unlikely Mr Sirisena, who was once a close ally of the former president, will do otherwise.

Image copyright Reuters Image caption Mr Fonseka (far right) was part of of a united opposition which inflicted a shock defeat on President Rajapaksa

Over a career of four decades, Sarath Fonseka has been Sri Lanka's most high profile and arguably its most tactically successful army officer, playing a key role in the defeat of Tamil Tiger rebels in May 2009.

President Sirisena had promised to rehabilitate him after the former general played a key role in his election victory earlier this month.

Rights groups say that Mr Fonseka and President Rajapaksa are both implicated in shooting Tamil fighters as they sought to surrender. Both men deny the allegations.

Mr Fonseka, who was nearly assassinated by a Tamil Tiger suicide bomber in 2006, once told the BBC the "crowning achievement" of his military career was wiping out the rebels.