President Bush is cutting loose his old ally, Pakistani President Pervez Musharraf, in hopes that Pakistan will end up a stable democratic ally like South Korea or the Philippines. But Pakistan also could go the way of Iran after President Jimmy Carter abandoned the Shah in 1979. The stakes could not be higher. Pakistan already has nuclear weapons. It is a central front in the war on terror. And it is besieged by Islamic extremists who already have a secure operating base in the country.
Musharraf, who seized power in a military coup in 1999, has been President Bush's friend and anti-terrorist ally since late 1981 - rather like Philippine dictator Ferdinand Marcos and South Korea's Chun Doo-hwan were anti-communist allies of President Reagan and Shah Reza Pahlevi was for several presidents in Iran.
In 1986, Marcos stole his last election and created a civic crisis. Reagan, influenced by then-Assistant Secretary of State Paul Wolfowitz and his deputy, Scooter Libby, decided to abandon Marcos and make a bet that democracy was a surer way to fight communism. The bet paid off.
The following year, in South Korea, military rulers Chun and Roh Tae-woo gave way to popular demands for democratic elections. Reagan supported the move after the fact, but it was driven more by the threat that Korea would lose the 1988 Olympics. But that bet on democracy paid off magnificently, too.
Now, Bush is making a similar wager in Pakistan. There's not much else he could have done, given Musharraf's increasing unpopularity, and Bush did it reluctantly. First, he tried to organize a power-sharing arrangement leaving Musharraf in the presidency while a new democratic coalition ran the government. Now, that's become untenable, as the two ruling parties seek Musharraf's ouster either by forcing his resignation or impeaching him.
In June, the White House announced that Bush had spoken on the phone with Musharraf and urged him to stay in the presidency. This week, with his position crumbling, Musharraf tried to call Bush at least twice, according to Pakistani sources. Bush did not take the calls.
It's a good sign that when Musharraf asked Pakistan's army chief of staff, Ashfaq Kiyani, to support his effort to stay in power, Kiyani said that the army would stay out of politics.
Musharraf's adversaries feared he would use constitutional authority he gave himself in his heyday to topple the elected government - which would have provoked popular unrest and might have put the army in the position of having to fire on the population. Kiyani, in effect, told Musharraf not to take that option.
So, the chances are strong that Musharraf will be gone any day now. The Bush administration is trying to secure guarantees from the leaders of the two opposition parties that Musharraf will not be criminally prosecuted after he leaves office.
Asif Zardari of the Pakistan Peoples Party, husband of the PPP's assassinated leader, Benazir Bhutto, has been willing to make such a deal. Nawaz Sharif of the Pakistani Muslim League has been demanding Musharraf's jailing but reportedly has relented.
Assuming that Musharraf is gone soon, Zardari is expected the assume the presidency. Then comes the real test of whether this democratic bet is paying off - or whether Pakistan will go the way of Iran.
In that case, the Shah had incurred the hatred of both Islamic radicals and secular democrats for running a corrupt and brutal regime. The United States was a target of resentment, too - much as it is in Pakistan - because of its unwavering support for the Shah.
In 1979, when massive demonstrations brought on Iran's moment of truth, the army declined to fire on the population. The Carter administration withdrew support from the Shah while offering him asylum, and a revolutionary regime took power.
Unfortunately, that regime still rules - with radical Shiite Islam and hatred for the United States as its guiding principles. It is now developing nuclear weapons and is aiding anti-U.S. and radical Islamic movements all over the Mideast.
Which future Pakistan will follow largely depends on whether Zardari and Sharif can govern effectively - inflation is running over 20 percent and unemployment is mounting - and defeat increasingly aggressive Islamic extremists, some aided by Pakistan's own intelligence service.
Four past tries at democracy failed. Bhutto served as prime minister from 1988 to 1990 and from 1993 to 1996, and Sharif also served twice before being toppled by Musharraf. Zardari and Sharif are now coalition partners but are still rivals.
Their government made one abortive try at negotiating with terrorist-linked tribal chiefs. Now, partly at U.S. prodding, the army is battling Taliban, al-Qaida and allied extremists near the border with Afghanistan.
Last week, al-Qaida's No. 2 leader, Ayman al-Zawahiri, declared war on the entire leadership of Pakistan, accusing it of "appeasing ... the modern day crusaders in the White House."
A top CIA counterterrorism expert, Ted Gistaro, told a Washington gathering this week that al-Qaida "now has [in Pakistan] many of the operational and organizational advantages it once enjoyed across the border in Afghanistan" before 1981 and can use them to train terrorists for worldwide attacks.
Conceivably, if democratic government were to fail again in Pakistan, the military would again take over and continue the anti-terrorist struggle. But there's also a danger that a pro-Islamic general would seize power.
But, as Pakistani Prime Minister Yousuf Raza Gilani said on his visit to Washington last month, democrats have every incentive to fight terrorism, too, waging "Benazir Bhutto's war." Islamic radicals are believed to have assassinated her - with help from elements of Pakistani intelligence.
Bush, as an advocate of democracy, has placed the only bet he could have in Pakistan. Now, it's incumbent upon him - and his successor - to do everything to ensure it pays off.