Sri Lanka's ex-army chief Sarath Fonseka left prison decrying the "vendetta" perpetrated against him on Monday, two years after being locked up following an unsuccessful bid to unseat the president.
"I am free. I will devote my life for my people," Fonseka shouted to thousands of supporters as he emerged from Welikada prison in Colombo, after receiving a pardon ordered last week by President Mahinda Rajapakse.
"I will not betray the people who stood behind me. I will save the country. The people will correct the injustice caused to me... I was a victim of a vendetta," he said.
Fonseka led troops to victory over the separatist Tamil Tiger rebels in 2009, but then fell out with Rajapakse over who deserved most credit for the military campaign, and ran against the president in a January 2010 election.
Speaking to AFP shortly after he returned to his home just outside Colombo, Fonseka said he wanted to re-immerse himself in political life, despite suggestions that he may be banned from running for office for several years.
"I see a political role for myself. I want to give back real freedom to our people. I want a political system where people will enjoy real democracy, human rights and real freedoms."
The government has not said why it freed Fonseka, but his Democratic National Alliance (DNA) party has said that it had been negotiating his release for five months.
Fonseka, 61, said the government was under pressure to release him and said he would keep up a campaign to change the "corrupt political culture".
"The government released me because of the pressure they had from outside the country as well as from the people inside the country," he told AFP.
The United States had regarded Fonseka as a political prisoner and kept up calls for his release.
He said he was uncertain about conditions of his release, but sources in the Attorney General's department told AFP that Fonseka was given a limited pardon and would not be able to run for office for seven years.
"If there are limitations on my pardon, I will fight to have them removed," Fonseka said.
Rajapakse on Friday ordered an official pardon for Fonseka, who was on Monday discharged from hospital back to jail after two weeks of treatment for a respiratory ailment.
Thousands gathered outside the prison to greet the former general as he emerged wearing white national dress and addressed hundreds of supporters waving national flags.
Two weeks after his poll defeat by Rajapakse in early 2010, Fonseka was detained on a charge of corruption relating to military procurements. He was given a 30-month jail sentence in September 2010.
In November 2011, he was sentenced to three more years in jail for saying that Tiger rebels who surrendered had been killed on the orders of the president's brother Gotabhaya Rajapakse, who is defence secretary.
Fonseka's DNA party, which he founded to contest the 2010 general election, has just three seats in the 225-member parliament.
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.
Sri Lanka has denied that any civilians were killed by its troops at the climax of the war, despite allegations that up to 40,000 civilians died in the war's final months.
The savage ethnic conflict is believed to have killed up to 100,000 people between 1972 and 2009.