He went on national TV to say that while he was confident the charges would not stand, this was not the time for more confrontation.
He is accused of violation of the constitution and gross misconduct.
Mr Musharraf has been a key ally of the US in its "war on terror" since he took power in a bloodless coup in 1999.
Reaction in Pakistan is overwhelmingly one of relief that a bruising and lengthy impeachment battle has been avoided, the BBC's Mark Dummett reports from Islamabad.
I leave myself in the hands of the people |
The key issue now is whether the ruling coalition, which had pushed for Mr Musharraf's exit since winning the February election, can stay united and deliver on its promises, he says.
It will have to agree on a new president, then persuade allies like the US and UK, and its neighbours like India and Afghanistan, that it will be committed to defeating militancy and terrorism, our correspondent adds.
International reaction to Mr Musharraf's resignation was mixed, with the US hailing him as strong ally against terrorism but Afghanistan welcoming his departure as a boost to democracy.
'No bravado'
Looking calm and dressed soberly in a dark suit and tie, President Musharraf said he had decided to resign after consulting his allies and advisers.
Lawyers in Karachi danced in jubilation at news of the resignation |
In a defiant speech, he said he had believed it was his destiny to save Pakistan, helped by God, and that he had prevented it from being declared a terrorist state.
In a clear reference to his political opponents, he accused unnamed elements of putting themselves above the country and seeking to betray it.
"Not a single charge can be proved against me," he said, while conceding he had made mistakes.
An impeachment process would have plunged the country into more uncertainty, he said, and it was no time for "individual bravado".
The outgoing president listed social, economic and infrastructural improvements made during his rule.
"I leave myself in the hands of the people," he concluded.
After making his speech, the former military leader inspected a guard of honour outside his white palace in Islamabad, stepped into a black limousine and left the presidency.
Cheering crowds poured into the streets of Pakistan's big cities to celebrate Mr Musharraf's departure. In Karachi, lawyers danced in jubilation.
'A friend to the US'
Once Mr Musharraf's resignation letter is received and accepted by the speaker of Pakistan's lower house of parliament, the speaker of the upper house will take over as acting president.
MUSHARRAF KEY DATES 12 Oct 1999: Deposes PM Nawaz Sharif in coup 20 June 2001: Names himself president while remaining head of the army 12 Jan 2002: Declares war against extremism in Pakistan 14 December 2003: Survives first of several assassination plots 3 November 2007: Declares state of emergency before judiciary can rule on his re-election as president 28 November 2007: Steps down as army chief to become a civilian president 18 August 2008: Announces he will resign as president |
He is Muhammad Mian Sumroo, a member of the pro-Musharraf faction of the Pakistan Muslim League.
The new president must be elected by both houses of Pakistan's parliament and the four provincial assemblies.
Reacting to news of the resignation, US Secretary of State Condoleezza Rice praised him as a "friend to the United States and one of the world's most committed partners in the war against terrorism and extremism".
She said the US would work with Pakistan's new leaders, pressing on them the need to stem "the growth of extremism".
The UK government wished Mr Musharraf well but stressed that relations did not depend on one individual.
India said it had no comment to make on the resignation since it was an internal matter of Pakistan.
Neighbouring Afghanistan, whose own President, Hamid Karzai, had a very fraught relationship with Mr Musharraf, hoped his departure would boost democracy in both countries.
Mounting pressure
Mr Musharraf's resignation followed more than a year of turbulence.
0 comments