He passed the baton of command to his hand-picked successor, General Ashfaq Kayani, at a ceremony at army headquarters in Rawalpindi.
Musharraf, who took power in a 1999 coup, is to be sworn in as civilian president on Thursday, having relinquished his position in the one institution that guaranteed his power.
"The system continues, people come and go, everyone has to go, every good thing comes to an end, everything is mortal," a tearful Musharraf told top brass and government leaders at the change-of-command ceremony.
The opposition parties of former prime ministers Benazir Bhutto and Nawaz Sharif, who are both mulling their participation in a January 8 general election, welcomed Musharraf's resignation.
"It is a pleasant moment in the history of Pakistan. Now our army will get a full-time general as its leader," Bhutto told reporters in Karachi.
Musharraf's power and influence are bound to be diminished. The question is by how much.
READER OPINIONS
SUBMITYOUROPINION
Please make sure you fill in all sections for your post to be submitted. Use n/a if not submitting details. The submission code below is case-sensitive. Also make sure you get confirmation that your comment has been submitted.