The third of three articles adapted from "Obama's Wars" by Bob Woodward.

President Obama dispatched his national security adviser, retired Marine Gen. James L. Jones, and CIA Director Leon Panetta to Pakistan for a series of urgent, secret meetings on May 19, 2010.

Less than three weeks earlier, a 30-year-old U.S. citizen born in Pakistan had tried to blow up an SUV in New York City's Times Square. The crude bomb - which a Pakistan-based terrorist group had taught him to make - smoked but did not explode. Only luck had prevented a catastrophe.

"We're living on borrowed time," Jones told Pakistani President Asif Ali Zardari at their meeting in Islamabad. "We consider the Times Square attempt a successful plot because neither the American nor the Pakistani intelligence agencies could intercept or stop it."

Jones thought that Pakistan - a U.S. ally with an a la carte approach of going after some terrorist groups and supporting others - was playing Russian roulette. The chamber had turned out to be empty the past several times, but Jones thought it was only a matter of time before there was a round in it.

Fears about Pakistan had been driving President Obama's national security team for more than a year. Obama had said toward the start of his fall 2009 Afghanistan-Pakistan strategy review that the more pressing U.S. interests were really in Pakistan, a nuclear power with a fragile civilian government, a dominant military and an intelligence service that sponsored terrorist groups.

Not only did al-Qaeda and the Afghan Taliban operate from safe havens within Pakistan, but - as U.S. intelligence officials had repeatedly warned Obama - terrorist groups were recruiting Westerners whose passports would allow them to move freely in Europe and North America.

Safe havens would no longer be tolerated, Obama had decided. "We need to make clear to people that the cancer is in Pakistan," he declared during an Oval Office meeting on Nov. 25, 2009, near the end of the strategy review. The reason to create a secure, self-governing Afghanistan, he said, was "so the cancer doesn't spread there."

Jones and Panetta had gone to Pakistan to tell Zardari that Obama wanted four things to help prevent a terrorist attack on U.S. soil: full intelligence sharing, more reliable cooperation on counterterrorism, faster approval of visas for U.S. personnel traveling to Pakistan and, despite past refusals, access to airline passenger data.

If, God forbid, the SUV had blown up in Times Square, Jones told Zardari, we wouldn't be having this conversation. Should a future attempt be successful, Obama would be forced to do things that Pakistan would not like. "No one will be able to stop the response and consequences," the security adviser said. "This is not a threat, just a statement of political fact."

Jones did not give specifics about what he meant. The Obama administration had a "retribution" plan, one of the most sensitive and secretive of all military contingencies. The plan called for bombing about 150 identified terrorist camps in a brutal, punishing attack inside Pakistan.

Wait a second, Zardari responded. If we have a strategic partnership, why in the face of a crisis like the one you're describing would we not draw closer together rather than have this divide us?