There has been a mixed reaction internationally to the resignation of Pakistan's President Pervez Musharraf.
Mr Musharraf was facing impeachment charges drawn up by the governing coalition.
Afghanistan welcomed his departure as a boost to democracy, but the US hailed him as strong ally against terrorism.
US Secretary of State Condoleezza Rice said the United States would work with Pakistan’s new leaders, pressing on them the need to stem what she called the ‘the growth of extremism’.
Mr Musharraf went on national television to say that while he was confident the charges would not stand, this was not the time for more confrontation.
'Not a single charge in the impeachment can stand against me,' he said.
'No charge can be proved against me because I never did anything for myself, it was all for Pakistan.'
He said that there was now law and order in the country, that human rights and democracy had been improved and that Pakistan was now a crucial country internationally.
The former army chief, who seized power in a bloodless coup in 1999, saw his popularity slide over the past 18 months and has been isolated since his allies lost a February election.
'My resignation will go to the speaker of the National Assembly today,' he said in the televised address.
'I leave my future in the hands of the people.'
It was reported that celebrations erupted in several cities after the announcement, with people dancing in the streets, although the country's political future - as well as Pakistan's role in the US 'war on terror' - remains far from certain.
The coalition government, led by the party of assassinated former prime minister Benazir Bhutto, said on 8 August it planned to impeach Mr Musharraf.
It accused him of incompetence and of violating the constitution.