An emotional Musharraf said in a televised speech that he leaves office knowing whatever he has done "was for the people and for the country."
"I hope the nation and the people will forgive my mistakes," Musharraf said toward the end of the address, much of which was devoted to defending his record and refuting criticisms.
It was not immediately clear whether Musharraf would stay in Pakistan. He said his fate was in the hands of the Pakistani people.
Musharraf dominated Pakistan for years after seizing power in a 1999 military coup, making the country a key strategic ally of the U.S. by supporting the war on terror. But his popularity at home sank over the years.
Many Pakistanis blame rising violence in their country on Musharraf's alliance with the U.S. His reputation suffered blows in 2007 when he ousted dozens of judges and imposed emergency rule. His rivals won February parliamentary elections and have since sought his ouster, announcing impeachment plans earlier this month.
Musharraf, who has been largely sidelined since his rivals came to power, had resisted mounting calls to resign in recent days, even as the coalition said it had finalized impeachment charges against him and could send a motion to Parliament later this week.
In announcing he would quit after all, Musharraf mentioned the many problems facing Pakistan, including its sinking economy. "I pray the government stops this down-sliding and take the country out of this crisis," he said.
Allies and rivals of the president said talks had been under way to get him to step down by possibly granting him legal immunity from future prosecution. The status of those talks was not immediately clear Monday afternoon.
With Musharraf's utility fading, Western concerns appeared less with his ultimate fate than about how the clamor was affecting the halting efforts of the new civilian government against terrorism and the gathering economic woes.
A U.S. Embassy spokesman declined to comment after Musharraf's speech, referring calls to Washington. U.S. Secretary of State Condoleezza Rice said Sunday the Pakistani president's future was an internal issue.
While Musharraf was a "good ally" who "kept his word" on ending military rule, whether he should resign "is a matter for Pakistan to determine," she said.