General Sarath Fonseka, who quit as chief of defence staff following a spat with President Mahinda Rajapakse, said he was committing himself to restoring the democratic rights of the people.
"I want to assure you that I will commit myself to protect democratic freedoms which we are rapidly losing," he said in a farewell letter to troops.
"I pledge to work to restore human rights, media freedom, social justice, ethnic unity and peaceful coexistence. I will be by your side like a shadow.
"
Fonseka is considered a war hero at home for his role in crushing Tamil Tiger rebels in an offensive earlier this year that ended the country's 37-year ethnic conflict.
His military drive, which finished in May when the Tiger leadership was wiped out, was strongly criticised internationally by rights groups which claimed thousands of civilians were killed during the fighting.
The government, however, denied any civilians were killed by security forces.
Fonseka said his security had now been