Sri Lanka's former army chief, imprisoned after losing an election to President Mahinda Rajapaksa, has been released from prison to cheers from thousands of supporters.
As firecrackers erupted in the background, Sarath Fonseka promised to continue his challenge to the government.
"I will sacrifice my life to serve the people of this country. My courage will not be shattered even if they detain me for 10 years and I will not stop performing my duty," he said.
He was freed as a result of a pardon issued by Mr Rajapaksa, who signed the official papers on Saturday.
Mr Fonseka's release came after foreign minister GL Peiris met US secretary of state Hillary Clinton in Washington on Friday, with the protection of human rights highlighted in their meeting. The US has called Mr Fonseka a political prisoner.
Though released from prison, Mr Fonseka will not be allowed to contest elections immediately. Under Sri Lankan law, a person who has served six months or more of a prison term longer than two years cannot run for election for seven years.
Tiran Alles, an opposition MP and a member of Mr Fonseka's political party who previously negotiated with Mr Rajapaksa to obtain his release, said they would hold talks with the government to obtain Mr Fonseka's voting rights too. A full presidential pardon could restore those rights.
Mr Fonseka - Sri Lanka's only four-star general - had been credited with leading the army to victory in the country's long and bloody civil war against ethnic Tamil rebels. But he was jailed after challenging Mr Rajapaksa in elections and court-martialled on several charges related to his military service. Mr Fonseka said the cases were a political vendetta to persecute him for daring to run against Mr Rajapaksa. The government denied the accusation.
The court-martial stripped him of his title, medals, pension and other honours, dishonourably discharged him from the army and sentenced him to a 30-month jail term.
In November 2011 he was sentenced to an additional three-year term for allegedly implicating the defence secretary and president's brother, Gotabhaya Rajapaksa, in war crimes during the civil war.