Pakistan's beleaguered President Pervez Musharraf announced his resignation on Monday in the face of an impending impeachment motion by the ruling coalition government.
The former army chief and firm U.S. ally has seen his popularity slide over the past 18 months and has been isolated since his allies lost a February election.
Prolonged jockeying and uncertainty over Musharraf's position had hurt Pakistan's financial markets, reported Reuters.
In a one-hour long televised address, Musharraf defended his nearly nine-year rule and rejected accusations against him, but said he was leaving office.
"After consultations with legal advisers and close political supporters and on their advice, I'm taking the decision of resigning," a sombre Musharraf said.
"My resignation will go to the speaker of the National Assembly today."
Musharraf seized power in a 1999 coup but has been isolated since his allies lost a February election.
The new coalition government, led by the party of assassinated former prime minister Benazir Bhutto, said early this month that it planned to impeach Musharraf.
The powerful army, which has ruled for more than half the country's 61-year history, has publicly kept out of the controversy over its old boss.
No unrest was expected as a result of the increasingly unpopular leader's resignation.
Investors in Pakistan's financial markets, while appreciating Musharraf's investor-friendly rule which, until this year, saw strong growth and surging stocks, welcomed his resignation as heralding an end to political uncertainty.
The ruling coalition had prepared impeachment charges against Musharraf focusing on violation of the constitution and misconduct.
Musharraf rejected the accusations but said the country would lose if he were impeached, no matter what the outcome.
Officials from Saudi Arabia, as well as the United States and Britain, have been involved in negotiations aimed at ending the confrontation between Musharraf and the government.
Coalition officials said Musharraf was seeking immunity from prosecution but he said in his speech he was asking for nothing.
"I don't want anything from anybody. I have no interest. I leave my future in the hands of the nation and people," he said.
Musharraf would move to Turkey's Buyukada
Turkish newspaper Vatan said on Monday that the chances grew stronger that Musharraf would move to Buyukada, an island off coast of Istanbul in the Marmara Sea, after the U.S. State Department has said the U.S. would not welcome the Pakistani leader.