Finally, after weeks of searching the caves and mountains of Tora Bora for traces of Osama bin Laden, CIA field commander Gary Berntsen believed his men had a good peg on the terrorist. Berntsen called in the big bomb – the BLU-82, a 15,000-pound device the size of a car.

The bomb was pushed out of the back of a C-130 transport plane. It struck with such force that it vaporized men deep inside caves. The devastation spread across an area as big as five football fields, killing numerous al-Qaida fighters – including, Berntsen believed, bin Laden.

It was three months after the attacks of Sept. 11, 2001, and Berntsen thought, “I’ve got him now.”

Six days later, two of Berntsen’s men were listening to a radio they had picked up from a dead al-Qaida fighter. They heard bin Laden addressing his troops in Arabic. The hunt went on.

Immediately after al-Qaida’s attack on Sept. 11, America went after the world’s most notorious terrorist with a quick-action injection of cash, commandos and massive firepower.

Within a few months, that first phase of the search for bin Laden would give way to a decade-long manhunt in which the tedious work of analysis and surveillance would eventually bag the target. To find bin Laden, who had declared holy war on the United States in 1996, the Americans needed to think more like him, to absorb the structures and rhythms of a terrorist network.

The search that ended Sunday with bullets to bin Laden’s head and chest was the result of a new approach to finding an elusive target, the product of a few dozen analysts in Langley, Va., who refused to accept that their prey may have vanished forever.

“I want justice. And there’s an old poster out West, I recall, that says ‘Wanted: Dead or Alive.’ “

President Bush,Sept. 17, 2001

Less than a month after the Sept. 11 attacks, U.S. bombers began hitting Afghanistan, hoping to bring down the Taliban government for giving al-Qaida sanctuary. On the ground, the hunt for bin Laden was also underway. A few dozen U.S. paramilitary troops, dressed as Afghans in beards and loose robes and accompanied by hired Afghan fighters, took up the chase.

The American presence at first was thin, and expertise was scarce. The CIA had had a team tracking bin Laden from back home at Langley since 1996, but now it scrambled to find officers who knew Afghanistan and could deploy immediately. Only about a dozen agency people were working in the country on Sept. 11, according to a former senior intelligence official who helped set up agency outposts there.

The first job was to identify tribal leaders and meet with them, always bringing gifts. “The message was ‘We’re your friends,’ ” said the senior intelligence official. “We’re everyone’s friends. But whoever hosts us is in line to get American money.”

This account of the hunt is based on interviews with more than 20 senior political, military and intelligence officials from the Clinton, Bush and Obama administrations, some of whom spoke on the condition of anonymity because they were not authorized to discuss operations.

CIA field commander Berntsen, who led a team charged with finding bin Laden, worked out of a Kabul guesthouse, fueling the hunt with several million dollars in cash that he kept stowed in a Rubbermaid tub. From that makeshift bank, he distributed payoffs in the thousands of dollars to informants in tribal villages where bin Laden sightings had been reported.

“I must have gotten eight reports at the time, saying he’s in this village here or that village there,” said Berntsen, who had investigated al-Qaida’s 1998 bombings of the U.S. embassies in Kenya and Tanzania. “He was stopping and giving speeches.”

Intelligence analysts would later learn where bin Laden was in the first weeks after the attack, mainly through interrogations of al-Qaida operatives held at CIA “black sites” overseas and at the U.S. military prison at Guantanamo Bay, Cuba.

But in the immediate aftermath of Sept. 11, the Americans had no idea that bin Laden and his chief deputy, Ayman al-Zawahri, were on the move, traveling through Afghanistan by car, meeting frequently with followers and Taliban leaders. According to classified U.S. military documents obtained by the anti-secrecy group WikiLeaks and based on interviews with detainees, bin Laden held court at a secret guesthouse in or near Kabul.

Acting like an exiled head of state, he received terrorist operatives from Afghanistan, Malaysia and elsewhere and met with leaders such as the Taliban’s Jalaluddin Haqqani. He issued instructions for campaigns against Western targets, lectured on Islam and history, and sent out a video boasting about how pleasantly surprised he was that the attacks had claimed so many American lives.

In early October, Yunis Khalis, an elderly Afghan warrior who controlled a swath of territory in the country’s east, including the regional capital of Jalalabad and the nearby cave complex at Tora Bora, sent a message to bin Laden telling him he could provide sanctuary for the al-Qaida leader.

Bin Laden had friends and followers all along the Afghanistan-Pakistan border. Even before the founding of al-Qaida in 1988, bin Laden had spent years in the area, developing relationships with tribal and religious leaders, many of whom he worked with side by side in the Afghan mujaheddin’s 1980s battles against the Soviet Union.

Khalis and bin Laden had known each other since those days, when Khalis, one of the most prominent leaders of the anti-Soviet resistance, had received tens of millions of dollars in guns and money from the CIA. He later introduced bin Laden to Mohammad Omar, the Taliban leader. After the United States began to bomb Afghanistan on Oct. 7, Khalis, then 82, called for jihad against the Americans.

Taking advantage of Khalis’s hospitality, bin Laden arrived in Jalalabad just two months after the Sept. 11 attacks and immediately began to spread cash among local tribes, either directly or through trusted intermediaries.

When the bombing around Jalalabad intensified, bin Laden fled into the fortified caves of Tora Bora, about 35 miles south of the regional capital. Bin Laden knew the territory; as a young man, he had driven bulldozers there as Afghan resistance fighters excavated miles of tunnels.

In late November, probably within days after bin Laden had arrived in the area, Berntsen’s team tracked him to a mountainous area called Milawa, just below the peaks of Tora Bora. Berntsen’s men called in airstrikes – a barrage from B-52s, F-15s and plenty more – that lasted nearly 60 hours.

“Our guys were exhausted; they had been hammering Osama for days,” Berntsen said. “Finally, bin Laden fled deeper into the mountains.”

Berntsen, who was back in Kabul, summoned several members of his team to tell him what they would need to take down bin Laden now that they thought they knew where he was. The response: “We need 800 Army Rangers between bin Laden and the border.”

Berntsen wrote to his superiors, begging for troops. His pleas went unanswered, according to a Senate Foreign Relations Committee report on Tora Bora. Without more manpower, Berntsen could not risk a ground assault.

Still, the Americans tried to stay close to bin Laden. Berntsen’s deputy, a CIA paramilitary officer, recruited an Afghan to trek into the mountains and offer bin Laden and his followers food and water, then report back on the terrorist’s location.

“The guy saw bin Laden and his son,” Berntsen said. “When you’re desperate, you’re desperate. And when you don’t have food and water, you’ll take it.”

As the United States carpet-bombed the cave complex, bin Laden and Zawahri urged their fighters to carry on against the Americans. In the bitter cold of the caves, bin Laden sipped mint tea. He heard pleas from his fighters for medicine and, with ever-greater urgency, escape routes.

A videotape later obtained by the CIA shows bin Laden in that period, teaching followers how to dig holes where they could spend the night without being seen by U.S. spy planes. As bin Laden speaks, a U.S. bomb explodes in the background. The terrorist casually notes that “we were there last night.”

The American campaign was conducted primarily from the air. Despite the pleas from CIA operatives, U.S. officials were reluctant to send in ground troops to flush out bin Laden. They told officers on the ground in Afghanistan that Pakistani troops would help them, cutting off bin Laden if he tried to cross into their country.

But in early December, over lunch at his palace in Islamabad, Pakistani President Pervez Musharraf made it clear to U.S. officials that he did not want to commit troops unless the Americans would help transport them to the border by air. According to Wendy Chamberlin, then the U.S. ambassador to Pakistan, Musharraf told her and Gen. Tommy Franks, commander of U.S. Central Command: “I’d put the troops in trucks, but that’ll take weeks. Could you give me air support?”

Franks would not comment for this article, but according to Chamberlin he was noncommittal about air support. Only later did she learn that the general was already “planning for Iraq,” she said. “Even if he could have helped out, he was already starting to have to reshuffle.” Without the air support, the Pakistanis sent some soldiers to the border, but never enough to secure it.

Back in Tora Bora, a team from Delta Force – the military’s secretive, elite Special Operations unit – planned to sneak up on bin Laden from behind, crossing into the terrorist’s suspected lair from Pakistan through an undefended back door. That would have required using supplemental oxygen to scale a 14,000-foot peak, but according to the leader of the Delta Force team, who later wrote a book under the pseudonym Dalton Fury, the plan had a better chance of succeeding than any frontal assault that relied on help from Afghan fighters.

Fury, the assault troop commander who retired from the Army as a major, said in an e-mail interview that the Pakistani forces who were supposed to seal the border “never made it there.” He said his superiors told him to skip the border-side assault and instead “align our mission with the Afghan mujaheddin to put an Afghan face on killing” bin Laden.

Fury didn’t trust the Afghans. “The mujaheddin were not very skilled or motivated fighters,” he said. But following orders, the Delta Force team stayed on the Afghan side of the border.

On Dec. 10, Fury’s team got a tip from a source who claimed to know bin Laden’s general location in the Tora Bora area. Thirty members of the team launched a hasty assault, but when some of them were abandoned by their Afghan allies behind enemy lines, the men halted their advance and spent two hours rescuing their mates. Fury aborted the mission.

The next summer, Fury’s men returned to Tora Bora with a forensics team to search 80 graves of al-Qaida fighters. None of the remains they dug up was a match for bin Laden.

The team stayed on the hunt. In December 2002, they conducted a nighttime raid on Tora Bora, capturing a man who had given medical care to bin Laden. But bin Laden was long gone. The trail had gone cold.

Tora Bora taught both sides important lessons. The Americans learned, as a top intelligence official said, “that it was a bad idea to ‘outsource’ something as important as capturing or killing bin Laden.” Mutual mistrust kept the Pakistani military and Afghan fighters from embracing the Americans’ search for bin Laden.

After Tora Bora, the Americans knew that “when the time came to move, we would do it ourselves,” said the official, who was involved in the search for years.

Bin Laden, who took the U.S. bombing seriously enough to have written his will in mid-December of 2001, learned that he had lost his safe haven and was now a fugitive on the run. “Hiding and isolation from operatives and recruits transformed him from a hands-on leader into an almost mythical figure within al-Qaida,” the intelligence official said. That new mystique lent additional import to each video or audio transmission that bin Laden managed to smuggle out, but it also dampened al-Qaida’s fundraising and recruiting capacity.

The popular version of bin Laden’s escape from Tora Bora was dramatic enough. Somehow, a hunted man made it over the mountains, south to the tribal areas of Pakistan.

But U.S. interrogators later learned from Guantanamo detainees that bin Laden had actually taken a more daring route, to the north toward Jalalabad, right past the approaching U.S. and British special forces and their Afghan allies. After resting there, he proceeded on horseback on a several days’ journey into Konar province, in Afghanistan’s far northeast. A U.S. intelligence official this week confirmed this account.

“It’s still unclear who bribed who and who talked to who,” the official said, but “bin Laden got out. Knowing the land, knowing the people who could direct you, he was able to get out to Konar,” into valleys “that no one has subdued . . . places the Soviets never pacified.”

Bin Laden and Zawahri next moved on to an “unknown location,” according to military documents. Some detainees reported that the two had stayed in Konar for up to 10 months. Even bin Laden’s closest followers didn’t know where he had gone, according to U.S. analysts who mined the interrogations of al-Qaida operatives.

“It became clear that he was not meeting with them face to face,” said an intelligence official. “People we would capture had not seen him.”

U.S. forces believed that at Tora Bora they had come within perhaps 2,000 yards of bin Laden. Yet he managed to slip away, vanishing so completely that several years went by without a single tip, surveillance photo or monitored transmission of any value. On the ground, American operatives continued to try to pry intelligence from “locals willing to talk for some pocket change,” Fury said. “The CIA did a lot of this fishing. Mind-numbing. A million dead ends.”

A few months after Tora Bora, as part of the preparation for war in Iraq, the Bush administration pulled out many of the Special Operations and CIA forces that had been searching for bin Laden in Afghanistan, according to several U.S. officials who served at the time.

Even the drones that U.S. forces depended on to track movements of suspicious characters in the Afghan mountain passes were redeployed to be available for the Iraq war, Lt. Gen. John Vines told The Washington Post in 2006. Once, when Vines’ troops believed they were within half an hour of catching up to bin Laden, the general asked for drones to cover three possible escape routes. But only one drone was available – others had been moved to Iraq. The target got away.

Back home, frustration over the long search led to a debate between critics of the Bush administration’s global war on terrorism, who argued that the cause of security would be better served by focusing on targeted strikes against bin Laden and al-Qaida, and defenders of the wars in Afghanistan and Iraq, who said the best way to contain terrorism was to take the fight to where the enemy lived.

As that debate raged, the analysts in the CIA’s HV Unit – dedicated to hunting for high-value targets (bin Laden was known in the agency as “HVT-1”) – began to envision the search in a new way.

“The story of hunting bin Laden is a story of increased sophistication in thinking,” said an intelligence official. Maybe bin Laden was in the mountains; maybe not. But that was the wrong question.

Even al-Qaida’s top guns didn’t know where bin Laden was, yet they still managed to get instructions from him. So the most important question was not “Where is bin Laden?” but rather “How does he communicate?”

Interrogations determined that bin Laden got his orders out only once a month, by courier, and that led analysts to decide that, as the intelligence official said, “you have to know the network, the couriers and how that leads to the location.”

At the White House, under pressure from mounting public skepticism about the hunt, Bush moved on a different track. He ordered up “Operation Cannonball,” directing the CIA to “flood the zone,” beefing up the number of officers on the hunt in Pakistan and Afghanistan. But there were no breakthroughs.

That did not discourage the analysts at the HV Unit. They were learning more about how al-Qaida worked, and that led them to think about networks in which information doesn’t get passed up through a hierarchy but rather is shared across all ranks.

The network idea was catching on in the military as well. In 2006, Army Gen. Stanley McChrystal launched raids against al-Qaida leaders in Iraq as well as in Yemen and Afghanistan, said a former White House official. To make those raids happen, McChrystal needed information to move in new ways, and he adopted a networked structure modeled on what he called al-Qaida’s “alarming” ability to grow quickly and shore up weak spots.

“To defeat a networked enemy,” McChrystal wrote in Foreign Policy, “we had to become a network ourselves.”

That meant instantly sharing intelligence with people throughout the battlefield rather than sending it up the chain of command. Video from drones was now delivered not just to analysts who controlled the unmanned flying cameras but also to combat teams on the ground. The result was a dramatic increase in the number of raids and their success rate.

At the CIA, analysts searched for clues not in caves but in books and interrogation transcripts. Even popular books such as “Growing Up Bin Laden,” by the terrorist’s wife Najwa and son Omar, were mined for insights. In the book, Omar says his father kept safe houses in Kabul because he believed the Americans would never bomb a big city, for fear of killing innocent civilians. That got analysts thinking about urban hideouts.

“Finding bin Laden was not a problem susceptible to human-wave tactics,” said an intelligence official who helped supervise the early years of the search. “Lots of people who knew little was almost certain to be less efficacious than a small, dedicated cadre of people with experience working the problem.”

The slow, painstaking work of analyzing data met with impatience at the White House, where “a little fatigue had set in,” said a former Bush White House official. “We weren’t about to find him anytime soon. Publicly, we maintained a sense of urgency: ‘We’re looking as hard as we can.’ But the energy had gone out of the hunt. It had settled to no more than a second-tier issue. After all, those were the worst days of Iraq.”

The troubled war in Iraq, mounting concern about Iran’s nuclear program, and the increasingly unstable situation in North Korea stole attention from the bin Laden hunt, White House and CIA officials said. The search for bin Laden, once the clarion cry of a nation bent on striking back, morphed into a topic Bush and his top staffers sought to avoid.

Through the next few years, leaders of the hunt hoped that the drones surveying the tribal areas would generate new leads, “but it was just a hope,” said Juan Zarate, Bush’s deputy national security adviser for counterterrorism in the middle years of the search. “It was a very dark period.”

“We can say to those families who have lost loved ones to al-Qaida’s terror: Justice has been done.”

President Obama,

May 1, 2011

In the Bush White House, the lack of credible leads led to public statements designed to play down the individual and focus attention on the broader threat. The idea was “not to overly aggrandize the man even as we tried to find him,” Zarate said. Outside the HV Unit, the landscape looked grim. “I can’t remember any single piece of intelligence that got us especially excited,” Zarate said.

But even as the hunt became a political liability, the road to bin Laden’s house in Abbottabad was being built, not “brick by brick,” said former CIA director Michael Hayden, but “pebble by pebble.”

Turning vague references to a courier into a verified name took upwards of four years, but that opened the way to discovering how he operated, and that led to the surveillance of the strangely overbuilt house that curiously had no phone or Internet service.

The couple of dozen U.S. commandos who dropped onto bin Laden’s compound in Abbottabad this week had to complete their mission in minutes, but it had taken years to get them there. The analysts who built that road believe that in addition to getting their man, they learned an essential lesson in how to think like their adversaries.

In 2006, bin Laden swore “not to die but a free man.” But Osama bin Laden died a prisoner in a jail of his own making, a man without a nation, living apart even from those who shared his belief that mass murder was the path to power.

In his final months, bin Laden could only watch as a wholly opposite force channeled the frustrations and aspirations of the Muslims for whom he claimed to act – a peaceful exercise of people power on the streets of cities across Tunisia, Egypt, Yemen and throughout the Middle East and North Africa, a stirring and decisive uprising by those who yearned for change yet turned their backs on the ways and means of Osama bin Laden.

Staff writers Karen DeYoung, Anne E. Kornblut, Ellen Nakashima and Joby Warrick; special correspondent Shaiq Hussain in Pakistan; and staff researcher Julie Tate contributed to this report.