He formally handed over the charge to Kiyani, the 52-year-old former chief of the Inter-Services Intelligence (ISI) agency who was hand-picked by him last month to head the 500,000-strong force.
Soon after Musharraf took off his uniform, Pakistani media reported that he is expected to end the emergency he imposed earlier this month "within the next 48 hours."
Musharraf was appointed Army Chief on October 7, 1998 by then Prime Minister Nawaz Sharif who promoted him over several other officers. The two men soon fell out over differences on several issues, including the incursion into the Kargil area of Jammu and Kashmir, with Musharraf seizing power in a bloodless coup in 1999 toppling the Sharif government.
All persons detained after the imposition of emergency are expected to be freed shortly.
Updated at 1155 hrs: President Pervez Musharraf today bade farewell to the army after serving the force for over four decades saying he was feeling a "little sad".
"I will not be in uniform tomorrow," Musharraf told guests and dignitaries at an impressive military ceremony before handing over the baton to his successor, former ISI chief Ashfaq Pervez Kiyani whom he described as an "excellent soldier".
The President, who bowed to intense domestic and international pressure to hang his uniform, said he was feeling "a little sad".
"After remaining in uniform for 46 years, I am saying goodbye to this army," he said.
"This army is my life, this army is my passion. I have loved this army," said Musharraf, who is slated to take oath as a civilian President tomorrow.
The military ruler was accorded a ceremonial guard of honour after he arrived for the farewell parade at a stadium at the Army Headquarters in the garrison city of Rawalpindi.