*******************************
Pakistani President Pervez Musharraf, facing impeachment on charges drawn up by the governing coalition, has announced that he is resigning.
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
Pervez Musharraf
Pakistani president
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.
Pakistani lawyers dance in jubilation in Karachi
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
President Pervez Musharraf inspects a guard of honour before leaving his palace on 18 August
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.
The unrest began last March when he confronted the judiciary, suspending the chief justice. After widespread strikes and protests, his decision was overturned by the Supreme Court.
Mr Musharraf won the presidential election in October - but the Supreme Court refused to confirm the result.
In November, he declared a state of emergency, citing increasing attacks by militants but eventually stood down as head of the army, giving up his main power base.
The parliamentary election this February, handed a clear victory to the two main opposition parties.
The coalition struck a deal to impeach the president earlier this month and finalised their charges against him hours before he stepped down.
*****************************************************
India fears vacuum left by Musharraf
The resignation of Pakistan's president, Pervez Musharraf, may have come as a relief to most people in his country.
But in Pakistan's giant neighbour, India, there are some who are less pleased and even anxious at his imminent departure.
Delhi has traditionally been restrained in its comments on Pakistan's internal politics, concerned that it may be seen as meddling.
So its first reaction after Monday's announcement was entirely predictable.
"We have no comments to make on the resignation of President Musharraf of Pakistan", the Indian Foreign Ministry Spokesman, Navtej Sarna, said in a statement. "This is an internal matter of Pakistan", he added.
But even as speculation on General Musharraf's future mounted during the past few weeks, one high-ranking official voiced what many in India fear - that his exit leaves a political vacuum in Pakistan.
In a recent interview, the Indian National Security Advisor, MK Narayanan, said Delhi was "deeply concerned about this vacuum because it leaves the radical extremist outfits with freedom to do what they like - not merely on the Pakistan-Afghan border but clearly on our side of the border too".
"Like nature abhors a vacuum, we abhor the political vacuum that exists in Pakistan. It greatly worries us," he said.
Nuclear neighbours
India has had a mixed relationship with Pervez Musharraf.
The removal of Musharraf would result in the military playing a more autonomous role on issues of relations with India
G Parthasarathy
Retired Indian diplomat
Many in the Indian establishment view him with deep suspicion, especially after the two countries fought a bitter conflict in 1999, in the Kargil region of Indian-administered Kashmir.
As the Pakistan army chief, he was largely viewed as the prime motivator of the conflict, which saw armed insurgents backed by the Pakistan army invade territory under Indian control, provoking a near all-out war between two nuclear-powered neighbours.
And his blunt comments on relations with India - which sometimes bordered on the belligerent - have often left foreign-office mandarins fuming.
But over the years Delhi has also learnt to deal with the former general.
There is a sense in the world's largest democracy that there is more to be gained with a military dictatorship that is all powerful and controls all organs of the Pakistani state, than with a relatively weak civilian administration that may be at odds with the country's powerful intelligence and military.
"The removal of Musharraf would result in the military playing a more autonomous role on issues of relations with India, including policies on [Kashmir], support for the Taleban and control over nuclear weapons," says a retired Indian diplomat, G Parthasarathy, in The Times of India newspaper.
Political uncertainty
A series of recent terror attacks on Indian targets and growing violence in Indian-administered Kashmir has soured the mood after a steady if unspectacular peace process that has been ongoing since 2004.
It culminated in last month's attack on the Indian embassy in Kabul, which Delhi publicly blamed on Pakistan's intelligence service - something that was immediately contested by Islamabad.
And last week, India was incensed after Pakistan spoke out against the killing of unarmed protesters in Indian-administered Kashmir by the security forces.
"We have never interfered in Pakistan's internal matters. Pakistan should do the same," warned Indian Foreign Minister Pranab Mukherjee.
With relations once again on the downside, the political uncertainty in Pakistan is deeply frustrating for India.
Privately senior Indian officials say they are unsure of whom to talk to in Islamabad and who is in control.
"Is it Prime Minister Geelani, Nawaz Sharif, Asif Ali Zardari or [army chief] General Kayani?" asked one official, who wished to remain unnamed. "We don't know", he told the BBC.
It is this kind of unpredictability that is very unsettling especially at a time when India is faced with growing insecurity in Kashmir and elsewhere.
More than anyone else, India will be hoping for political stability in Pakistan.
****************************************
Pervez Musharraf's mixed legacy
For nearly a decade Pervez Musharraf was the most powerful man in Pakistan.
His resignation marks the end of an era for a country facing enormous economic and security challenges.
He will be remembered for many things.
He overthrew an elected government in a military coup. He took Pakistan to the brink of war with India, only to launch a sustained peace process a few years later.
In the aftermath of the 11 September attacks in New York and Washington he declared his full support for the United States and became a key player in the American-led war on terror.
War on terror
He was also responsible for modernising many sections of Pakistani society.
But he brooked no opposition, and weakened important state institutions. And in the end he has fallen victim to hubris, the feeling that he was indispensable and he could do no wrong.
He leaves Pakistan as a more fragile and fractured country than it was when he came to power.
"There will be a more balanced view of him in the future than there is now," argues Mushahid Hussein, a leading political supporter.
"A lot of things happened in Pakistan for the good under his watch, and I think that is something the history books will recall after some time."
"As far as democracy in Pakistan is concerned," counters Senator Enver Beg of the Pakistan People's Party, "historians will not forgive him."
"He manipulated elections, he hounded his opponents, and he became a dictator. It's not much of a legacy."
His most significant international decision was to throw in his lot with George Bush and the United States after 9/11. He abandoned the Taleban in Afghanistan and worked closely with the Americans in pursuing Islamic extremism.
In return Washington has given Pakistan more than $10bn in aid, mostly to the military, since 2001.
But many of the gains from this strategic alliance have been frittered away.
Pakistan's lawless border regions close to Afghanistan remain a sanctuary for al-Qaeda, and a new Taleban insurgency inside Pakistan has gradually been gathering strength.
Military co-operation with the Americans has also become increasingly unpopular in Pakistan. As President, Pervez Musharraf never managed to persuade a majority of his people that he was doing more than fighting someone else's war.
"He never tried to create an impression in Pakistan that we were fighting for our own country and our own good," says military analyst Talat Masood, a retired lieutenant-general.
"And because of that the Pakistan army became a client army and Pakistan became a client state in the eyes of the people. It was a major failing on his part."
On Pakistan's eastern border, relations with India have also been predictably volatile.
As army chief, Gen Musharraf launched a military adventure in Kargil in 1999, shortly before his military coup. Pakistani soldiers and Kashmiri militants infiltrated Indian territory, before pressure from the United States forced them to withdraw.
Low ebb
And then an armed attack on the Indian parliament in Delhi in 2001 prompted a rapid military build-up on both sides of the Indo-Pakistani border which brought South Asia's nuclear neighbours close to war.
But from 2004 onwards a peace process between the two countries, in which Pervez Musharraf invested a considerable amount of personal prestige, led to a ceasefire and a series of confidence building measures.
As Mr Musharraf leaves office, though, relations with India have fallen to another low ebb.
The government in Delhi is convinced that a suicide bomb attack by Islamic militants on its embassy in Kabul last month was organised under the auspices of Pakistani intelligence agents.
At home Pervez Musharraf's first few years in power seemed to promise the hope of a fresh start and a modernising agenda. He liberalised the economy and the electronic media.
He backed the empowerment of women and made efforts to improve standards in education.
He also has the distinction of leaving high office with no serious charges of corruption against him. In Pakistan, that is quite a rare event.
But in the last 18 months he clearly over-reached himself. He thought he could take on the judiciary, the parliament and anyone else who disagreed with him with no consequence.
'Overconfident'
He sacked the chief justice, imposed a state of emergency and engineered his own re-election as president.
"He was too cocksure, he was overconfident," admits Mushahid Hussein. "But the ground realities had changed."
Critics say one of the most damaging parts of his legacy is the fact that his disregard for civilian institutions has weakened the Pakistani state.
He encouraged the spread of military influence into all walks of life, and always appeared more comfortable with men in uniform.
"He didn't understand the importance of other institutions," says Talat Masood. "And he didn't understand that a country of 160 million people couldn't be ruled by just one man."
In some respects he was a victim of his own success.
The Musharraf era saw the emergence of a more assertive middle class, who were in the forefront of protests against his imposition of emergency rule.
But towards the end of his presidential career even the economic accomplishments he could claim as his own were tarnished by the sapping negativity of months of political crisis.
In July 2008 annual inflation was over 24%, while the value of the rupee fell dramatically as the long political stalemate dragged on.
"He overstayed his welcome," says Enver Beg of the PPP. "It's time for life without Musharraf, it's time to move on."
**************************************
The strongman and the war on terror
The resignation of Pakistani President Pervez Musharraf is a sign of how the "war on terror" is changing.
Mr Musharraf was once the lynchpin of Pakistan's alliance with the United States in President George Bush's "war on terror", but the days of a single strongman laying down and executing the policy are gone.
Instead, a longer-term reliance on the emergence of democratic institutions to offer an alternative to extremism is taking place.
This partly explains why for the US and Britain, the departure of their former ally matters less than it once would have. His time came and went.
In the immediate aftermath of 9/11, President Bush drew up battle lines and President Musharraf stepped forward to take his place in the front line.
War on Terror changing
But today, al-Qaeda is seen as a weakened organisation, on the defensive in Iraq and unable to regroup in Afghanistan, while retaining its ambition and potential to cause real damage.
In such a situation, there is less need for battle cries against extremism - and more of a need for the building of representative governments - as in Iraq and now in Pakistan.
The "war on terror" is proving to be a generational struggle, similar perhaps to the Cold War, which saw communism in power across Russia, half of Europe and China for 50 years before it collapsed or significantly changed.
During that time, the Western democracies adopted a twin track approach - maintaining strong military power while developing a responsive form of government.
The same tactics are coming to prominence as the "war on terror" progresses.
Civilian leadership
In Mr Musharraf's place comes a civilian leadership, albeit in an unstable coalition government whose future is uncertain and whose ability to combat the extremism in the tribal areas is untested. Nobody yet knows who will be the next president.
But the coalition was the product of elections, not a coup, and therefore is now being projected by Washington and London as a surer basis for future action than the weakened Musharraf.
It is from the tribal areas, the US and Britain say, that Taleban fighters cross into Afghanistan where they present a real danger to Nato forces supporting the Afghan President, Hamid Karzai.
This link provides a major incentive for the US and UK to follow and - and try to influence - events in Pakistan so closely.
Role of military
A great deal also depends, as always in Pakistan, on the military. The army chief, General Ashfaq Kayani, has moved to align himself with the civilian leadership and not long ago reassigned some senior commanders appointed by Mr Musharraf as a signal of his intentions.
But the army still faces a huge task in the border regions.
Pakistan remains therefore at the heart of a region of concern for much of the world.
Alarming predictions that a nuclear-armed Pakistan would fall into the hand of Islamic fundamentalists, however, have not materialised.
*******************************************************
Musharraf resigns: Reaction in quotes
Pakistan's President Pervez Musharraf has said he will resign after nine years in office. World figures and Pakistani political leaders have been giving their reaction.
ANAND SHARMA, INDIAN MINISTER OF EXTERNAL AFFAIRS
It is an internal development of Pakistan. We wish Pakistan stability and we want that peace prevails there and democracy strengthens. We are very clear - we will always be talking to the government of Pakistan and the leadership of Pakistan, whoever is the president or prime minister of that country.
AFGHAN FOREIGN MINISTRY SPOKESMAN
We hope that the resignation will have a positive impact on strengthening the government and democracy in Pakistan. Afghanistan wishes a stable, democratic Pakistan based on the rule of law.
CONDOLEEZZA RICE, US SECRETARY OF STATE
We will continue to work with the Pakistani government and political leaders, and urge them to redouble their focus on Pakistan's future and its most urgent needs, including stemming the growth of extremism, addressing food and energy shortages, and improving economic stability. The United States will help with these efforts to see Pakistan reach its goal of becoming a stable, prosperous, democratic, modern, Muslim nation.
SPOKESMAN FOR US PRESIDENT GEORGE W BUSH
President Bush is committed to a strong Pakistan that continues its efforts to strengthen democracy and fight terror.
SPOKESMAN FOR BRITISH PM GORDON BROWN
During President Musharraf's time in office we have seen a deepening of UK-Pakistan relations. We wish him well in the future. But relations between the UK and Pakistan don't depend on individuals and, as we have made clear, we support measures that promote strong democratic institutions which lead to greater stability, democracy and rule of law in Pakistan.
DAVID MILLIBAND, BRITISH FOREIGN SECRETARY
Pakistan is a vital friend of the UK and it is essential for Britain's security that it has a strong and democratic government with a clear mandate. The responsibilities on political leaders in Pakistan are now significant. They need to come together to ensure that the recently-elected government carries forward an economic and security agenda consistent with the long-term interests of the Pakistani people.
YASUO FUKUDA, JAPANESE PM
What kind of changes does this bring to the "war-on-terror" and the Afghan situation? I don't expect any significant change for now. I would expect different things would occur later. But it is not a time for us to make predictions.
FRENCH FOREIGN MINISTRY
We would like the next president and the Pakistani government to work together in a constructive climate and with respect for the institutions to address the many challenges facing Pakistan.
GERMAN FOREIGN MINISTRY
The German government hopes that the democratic government in Pakistan, and also the future president, will now seize the opportunity to bolster the democratic institutions in Pakistan and address the urgent challenges facing the country. Germany will continue to stand by Pakistan in the future as the country develops and stabilises its democracy.
RUSSIAN MINISTRY OF FOREIGN AFFAIRS
Russia hopes that the resignation of Pervez Musharraf will have no negative consequences for the political stability of this great Asian state. We hope that the situation in Pakistan will not leave the limits of the constitutional framework and will remain within the framework of legality and respect for order.
BILAWAL BHUTTO ZARDARI, CHAIRMAN OF PAKISTAN PEOPLE'S PARTY (PPP)
After the martyrdom of my mother (Benazir Bhutto) I said that democracy was the best revenge - and today it was proved true. Someone from the Pakistan People's Party would be the next president of Pakistan but I don't know who that would be.
FAROOQ NAEK, PAKISTAN MINISTER FOR LAW AND PARLIAMENTARY AFFAIRS
Democracy is going to flourish in the real sense and the people of Pakistan would see that in this country, the rule of law, supremacy of parliament, would be there.
ENVER BAIG, SENATOR, PPP
This is news which was long-awaited by the people of Pakistan. It is a very wise decision on his part, and it is a big day for the people of Pakistan and for democracy in this country. I think that a realisation has now come that military dictatorships do not give good results.
DELAWAR ABBAS, SENATOR, PAKISTAN MUSLIM LEAGUE (PML-Q)
It is in the larger interest of the nation and the country that President Musharraf has taken such a decision, which we accept as a party. The president, who was a bone of contention for (PPP and PML-Q) is now gone, and now they will start their own course of action and thinking - two separate parties, two separate chiefs.
SYED NAVEED QAMAR, PAKISTAN FINANCE MINISTER
I think we took a long time in getting through this but finally the day has arrived. It is a very happy day for the entire nation and I hope that now the coalition can divert its attention to solving the rest of the problems of the country.
AHSAN IQBAL, SPOKESMAN FOR PML-Q
Our stance is quite clear - that General Musharraf is nobody. If a trial is carried out, then in the future no one in Pakistan will dare to even think of breaking the constitution. The crimes against the Pakistani nation - against Pakistan's judiciary, against rule of law and democracy in Pakistan - those cannot be forgiven by a person or a party.
________________________