In a farewell to Pakistani troops, Pervez Musharraf has told them they are "the saviors" of the country.
Musharraf has stepped down from his post as military commander, a day before he's to be sworn in as Pakistan's civilian president.
At a ceremony in Rawalpindi, he appeared to be blinking back tears as the guard of honor marched by for the last time.
His retirement from the military has been a key opposition demand, and it may help defuse a possible boycott of parliamentary elections in January by parties opposed to his rule.
Since seizing power in a coup in 1999, Musharraf has also served as president while retaining his post as head of the armed forces.