Half an hour had passed on the ground, but the American commandos raiding Osama bin Laden’s Pakistani hideaway had yet to find their long-sought target.

Two of bin Laden’s protectors were already dead, shot by the Navy SEALs carrying out the raid, and one of the U.S. helicopters sat crippled in the courtyard. Pakistan’s military, which had been kept in the dark about the operation, was scrambling to respond to reports of explosions and gunfire at the one-acre compound.

The commandos swept methodically through the compound’s main building, clearing one room and then another as they made their way to the upper floors where they expected to find bin Laden. As they did so, Obama administration officials in the White House Situation Room listened to the SEAL team’s conversations over secure lines.

“The minutes passed like days,” said John O. Brennan, the administration’s chief counterterrorism adviser. “It was probably one of the most anxiety-filled periods of time, I think, in the lives of the people who were assembled.”

Finally, shortly before 2 a.m. in Pakistan, the commandos burst into an upstairs room. Inside was bin Laden. With a burst of gunfire, one of the longest and costliest manhunts in modern history was over.

The operation, which was planned for months but hidden from all but a tiny circle of administration officials, marked the culmination of a search often seemingly so futile that top U.S. intelligence officials would answer questions about bin Laden’s whereabouts with a helpless shrug.

It was a search that employed Predator drones, sophisticated signal interception equipment, networks of informants, and teams of analysts who scrutinized every video and audio recording from the al-Qaeda leader for inadvertent clues.

In the end, “he was more or less hiding in plain sight,” a senior U.S. intelligence official said. “The only resident of the compound that was taken from the site was Osama bin Laden. He died — almost certainly — from a bullet to the head.”

For years, bin Laden’s whereabouts were a guessing game, an unknown destination at the end of a trail that had gone utterly cold. But over the past year, U.S. spy agencies finally narrowed the circle by homing in on a relatively mundane target: a small network of couriers thought to be bin Laden’s only point of contact to the outside world.

One courier in particular unknowingly led them to a newly built residence north of Islamabad. When American analysts scrutinized the place, “we were shocked by what we saw,” a senior Obama administration official said.

The compound’s main building was three stories tall but had few windows facing outside. The facility appeared to be worth at least $1 million, but had no telephone or Internet connections. Its 12-to-18-foot security walls were topped by barbed wire.

It was far from the tribal areas where lower-level militants dodge Predator strikes. Indeed, the compound was a short distance from Pakistan’s military academy. U.S. documents released by the WikiLeaks anti-secrecy Web site describe plans to send U.S. special operations soldiers to Abbottabad in 2008 to train Pakistani troops. In contrast to the legend of al-Qaeda and its founder, bin Laden was not hiding in a cave.

Much about the U.S. operation remained secret Monday. But U.S. officials provided new details about the chronology of events leading up to the raid, describing high-level meetings at the White House as well as daring operations on the ground.

A crucial break appears to have come on May 2, 2005, when Pakistani special forces arrested a senior al-Qaeda operative known as Abu Faraj al-Libbi, who had been designated bin Laden’s “official messenger” to others within the organization. Libbi was later turned over to the CIA and held at a “black site” prison where he was subjected to the harsh methods that the George W. Bush administration termed “enhanced interrogation techniques.”

Libbi and other detainees pointed CIA interrogators to another messenger with close ties to the al-Qaeda leader. U.S. officials said they started only with the mystery courier’s nom de guerre, and that it took four years to uncover his actual identity, his approximate location in Pakistan and ultimately the compound where bin Laden was found.

Obama was first made aware of the potential breakthrough last September, as CIA analysts grasped the significance of the succession of clues. On March 14, Obama held the first of five National Security Council meetings in the span of a month devoted to the questions of whether and how to target the newly discovered site.

“We weren’t certain in August 2010 that bin Laden was there,” said the senior U.S. intelligence official. “Earlier this year, our confidence level grew much higher.”

That confidence grew in large part because analysts monitored the compound so closely that they came to know its daily rhythms and the identities of its residents. Analysts concluded it was built to hide “someone of significance,” and that a third family was living on the floors above the courier and his brother.

It remains unclear when bin Laden first arrived, but officials said that the compound was under near-constant scrutiny by the United States, and that it appears the al-Qaeda leader rarely — if ever — ventured outside.

Indeed, U.S. officials said the timing of the raid was not driven by worry that bin Laden was about to leave, but by the accumulation of confidence that their intelligence on his location was dead on.

On Thursday afternoon, Obama gathered his senior national security team in the Situation Room for a final review of the operation, according to one member present who requested anonymity to speak candidly.

Three options were under consideration: The first was a raid using Special Forces, but Obama was also asked to consider a strike from a “standoff platform,” most likely a drone. The third — to wait for more definitive intelligence — would have sounded distressingly familiar to a prior generation of officials who had to explain why there had been such reluctance to pursue bin Laden before the Sept. 11, 2001, attacks.

“Everyone, in going around the table, began by saying, ‘Well, this is a very tough call,’ ” a senior administration official said. Obama, the official said, told the group, “I’m not going to give you my answer now.”

It wasn’t until 8 a.m. Friday that Obama, in a meeting with national security adviser Thomas E. Donilon, his deputy Denis McDonough, Chief of Staff William M. Daley, and Brennan, told the group to move ahead.

He then boarded Marine One, waiting for him on the South Lawn, to carry him on the first leg of a trip to tornado-ravaged Alabama.

The Navy SEAL commandos picked for the mission had trained for weeks, practicing daily at a precise replica of the compound that they came to know every wall and external feature, as well as where every occupant was likely to be found. The rehearsals also covered a range of scenarios, including the possibility that bin Laden would try to surrender. So the SEAL team members practiced how to take him prisoner, according a military official briefed on the plan. Using Arabic commands, the insertion team would offer bin Laden a chance to give up, and would fire only if he resisted.

“As much as they may have wanted to see him dead, they were ready to offer him a chance to give up,” said the official, who agreed to speak about the mission on the condition of anonymity.

In the end, bin Laden showed no interest in being captured alive.

The SEAL team flew from Afghanistan into Abbottabad aboard two Black Hawk helicopters, U.S. officials said. The raid created enough of a commotion that a Pakistani resident of the city posted a series of tweets describing the sounds of helicopters and explosions.

The most serious stumble occurred at the start: One of the helicopters had a mechanical failure and tumbled into a courtyard, its tail clipping a 12-foot wall. Navy SEALs who were supposed to be dropped safely outside the perimeter were scrambling for cover in bin Laden’s yard.

“Seeing that helicopter in a place and in a condition that it wasn’t supposed to be — that, at least for me and I know for the other people in the room, was the concern,” Brennan said.

A third helicopter, a Chinook, was sent to the scene for emergency support. Meanwhile, the team dropped outside the compound joined the unit from the damaged helicopter and pressed ahead, exchanging fire with the courier and his brother until both men were killed.

The commandos moved inside, and finally reached bin Laden’s upstairs living quarters after nearly 40 minutes on the ground. What words if any were exchanged between the Americans and the Saudi-born terrorist are not publicly known, but the SEALs used the code word “Geronimo” to inform their commanders that they had found the target.

“The woman presumed to be his wife . . . was shielding bin Laden,” Brennan said, adding that it was not clear that anyone had forced her to take the action. The White House later said that a woman who died in the assault was not one of bin Laden’s wives.

A White House spokesman said Tuesday that bin Laden was unarmed, but “resisted.”

The al-Qaeda leader was shot at least once in the head and died instantly, U.S. officials said.

News footage from inside the rooms of the compound showed the aftermath of a ferocious struggle, with blood-soaked carpets and overturned furniture. ABC News, which obtained the footage, said computer equipment appeared to have been seized in the raid. A senior U.S. intelligence official confirmed that the SEAL team seized material from the compound that was being scrubbed for possible leads to other terrorist suspects.

All told, four men and one woman lay dead. Only the body of bin Laden was carried away as the commandos made their way to a designated collection point outside the complex, destroyed the downed helicopter and boarded Black Hawk and Chinook for the return flight to Afghanistan.

Only after the commandos slipped out of Pakistani airspace did Obama call Pakistan’s president, Asif Ali Zardari, to inform him of the U.S. military raid 35 miles, as the crow flies, from the Pakistani capital.

A series of top-secret briefings at the White House on Sunday afternoon conveyed, with rising certainty, news of the operation’s success. At 7:01 pm, the president was told there was a “high probability” that bin Laden was dead.

Staff writers Peter Finn and Scott Wilson and staff researcher Julie Tate contributed to this report.