‘In the name of Allah the most gracious the most merciful. Praise Allah and pray on his prophet. To the esteemed brother, Sheikh Mahmud, Allah protect him.”

Holed up in his compound in Abbottabad, Pakistan, Osama bin Laden sat at a computer and set down his thoughts in a long letter dated April 26, 2011, to Atiyah Abdul al-Rahman, his third-in-command and the link to his far-flung and beleaguered followers—the man he addressed as Sheikh Mahmud. It was the al-Qaeda leader’s sixth spring of confinement in Abbottabad. His hair and beard had grown white. Ten years after the 9/11 attacks, bin Laden’s life had shrunk to the cramped and crowded space of the upper two floors of a house behind high walls. His days consisted of familiar routines, rarely broken: his meals, his seven daily prayer sessions, his readings, the poetry lessons for his children and grandchildren, the sermons to three of his wives, the brisk daily walk around the vegetable gardens.

In his letter to Sheikh Mahmud, he raced to catch up with the Arab Spring, to interpret the events in light of his own immutable beliefs. Bin Laden also hammered home some advice about security. After more than nine successful years in hiding, he considered himself to be an expert: “It is proven that the American technology and its modern systems cannot arrest a Mujahid if he does not commit a security error that leads them to him,” he wrote. “So adherence to security precautions makes their advanced technology a loss and a disappointment to them.”

The computer turned bin Laden’s words into neat lines of uniform Arabic. He was feeling confident. He had five days to live.

I. The Pacer

Eight months earlier, on a hot day in August, Tom Donilon, then the deputy national-security adviser, had added a brief item to the end of his daily morning briefing for Barack Obama. He said, “Leon and the guys at Langley think they may have come up with something”—something related to bin Laden.

There had been no scent of the al-Qaeda leader for more than eight years, ever since he had slipped away from the mountain outpost of Tora Bora during a botched siege by allied troops. The Bush administration maintained that he was somewhere in the mountainous regions of northwestern Pakistan, but, in truth, they had no idea where he was. On May 26, 2009, Obama had concluded a routine national-security briefing in the Situation Room by pointing to Donilon, Leon Panetta, his newly appointed C.I.A. director, Mike Leiter, director of the National Counterterrorism Center, and Rahm Emanuel, his chief of staff.

“You, you, you, and you,” he said. “Come upstairs.”

The four followed Obama through the warren of narrow West Wing hallways to the Oval Office. They didn’t sit down.

Obama said, “Here’s the deal. I want this hunt for Osama bin Laden and [Ayman] al-Zawahiri to come to the front of the line. I worry that the trail has gone cold. This has to be our top priority and it needs leadership in the tops of your organizations.” He added, “I want regular reports on this to me, and I want them starting in 30 days.”

The conventional wisdom is that the intelligence apparatus had slackened off in its search for bin Laden—and it’s true that President George W. Bush, frustrated by the inability to find him, publicly declared that bin Laden wasn’t important. But among the analysts and operatives, the hunt had always continued. Obama’s order just gave it more focus and intensity. Now, a year later, there was something to talk about. While looking for an al-Qaeda figure who went by the name Abu Ahmed al-Kuwaiti—a man known to have once been a trusted aide and courier for bin Laden—intelligence analysts had become aware of a curious compound just outside Abbottabad, a prosperous city about 30 miles northeast of Islamabad. Too wary to use cell phones or Internet links, bin Laden relied on couriers to distribute his letters and occasional video and audio pronouncements. Reversing the paths taken by these tapes or thumb drives always ended one or two steps short of bin Laden’s inner circle. But now they had someone who might take them all the way inside. The search for him had lasted eight years. It had taken the C.I.A. five years just to learn his real name: Ibrahim Saeed Ahmed. The trail had ended at this residence.