An implausible set of political circumstances has produced a very positive outcome in Pakistan's general election.
Having sacked the supreme court and cynically engineered his own re-election as president, Gen Pervez Musharraf was on course to do a political deal for survival with Benazir Bhutto last December when she was assassinated, presumably by Islamic militants. After some hesitation and jockeying, he had little option but to call these elections.
That they have produced a remarkable victory for secular parties is a tribute to the maturity of Pakistani voters and their desire for a more accountable democratic system.
The major questions thrown up by the result are how a stable coalition of his political opponents can be forged and whether it will hasten Gen Musharraf's departure. Ms Bhutto's centre-left Pakistan Peoples Party - now led by her husband and son - has emerged with most votes, followed by Mr Nawaz Sharif's centre-right Pakistan Muslim League, with Gen Musharraf's more Islamist party trailing badly. Extreme Islamist parties barely registered in the results.
So much for assumptions that political chaos would open up opportunities for radicalisation. The two leading parties are going into coalition.
This is probably a fatal setback for army rule, represented by Gen Musharraf, even if the opposition parties fail to muster the two-thirds majority in parliament needed to impeach him. They are likely to demand reinstatement of the former supreme court chief justice, Iftikhar Chaudhary, sacked by Gen Musharraf last autumn.
That is worth supporting because of his role in representing a principled rule of law against military autocracy. He enjoyed growing public support before his departure, which has been fully borne out by the voters. There are some signs that the army has accurately absorbed the political lessons and is preparing to withdraw to the sidelines.
Gen Musharraf should follow them from power. Although that he insists he will serve the full five-year term given to him by the outgoing parliament, that position lacks all legitimacy in the face of its new majority. Going down with him is likely to be the strategy followed by the United States and other western states of relying on him as a bulwark against subversion in Pakistan and neighbouring Afghanistan.
Fears about control of Pakistan's nuclear weapons, worries that civilian rule would provoke the armed forces into intransigent opposition and concerns about relations between its Islamic radicals and the Taliban caused a cocktail of instability to be projected on to the country, to which Gen Musharraf appeared the only realistic alternative.
He no longer has the political credibility for such a task. That is not to say there is an easy path towards a better dispensation to rule this turbulent nation of 160 million people in such a strategic region. But the Pakistani voters' desire for that must be respected.