The unexpected end to Osama bin Laden's life came years after the United States captured one of his most trusted lieutenants.

Khalid Shaikh Mohammed was the senior al Qaeda member who originally conceived the Sept. 11 attacks and later managed the team that brought down the World Trade Center.

He is also the source of a key confirmation that U.S. counterterrorism professionals used in their long, painstaking effort to track down bin Laden: the code name of the courier who ferried messages to the al Qaeda leader up until his recent death.

Last year, U.S. officials heard that courier talking on a wiretapped phone and through this link they eventually found their way to a compound in Abbottabad, Pakistan, where bin Laden was shot dead earlier this month.

Very little information has been made public about the way in which interrogators found and identified the courier, though author and journalist Richard Miniter has heard the story of how Mohammed gave up his name years ago.

It involved building up a rapport with bin Laden's confidant, the use of an illustration of a man the U.S. was looking to identify and a hunch in a moment of interrogation that Mohammed was hiding something useful.

"Inside al Qaeda, everyone is given a code name and people don't necessarily know each other's real names," Miniter said in a recent telephone interview, explaining the difficulties in identifying the members of the terror organization.

But senior members like Mohammed have access to this kind of information and U.S. officials were able to exploit his knowledge to learn who that courier was.

"When we say code name, or nom de guerre, this is the name by which he was known inside al Qaeda and that came from Khalid Shaikh Mohammed," he said.

A long-awaited capture

Even before Sept. 11 happened, Mohammed was a wanted man in the United States.

It was his nephew, Ramzi Yousef, who first bombed the World Trade Center in 1993 and the U.S. would later determine that Mohammed helped fund the deadly attack.

By the late 1990s, the United States had unsealed an indictment that accused Mohammed with involvement in a plot to bomb U.S. airliners.

So when America woke up to the shocking attacks of Sept. 11, the U.S. had already been hunting for Mohammed for years. And his involvement in the devastating strikes against New York, Pennsylvania and Washington made his capture an even higher priority.

But Mohammed managed to elude the grasp of U.S. justice for many months, while continuing to plot out deadly acts of terror.

As Miniter writes in the recently released "Mastermind: The Many Faces of the 9/11 Architect, Khalid Shaikh Mohammed," during that time period the senior al Qaeda operative was "spending time with two small sons…and planning elaborate atrocities."

For the first few months after Sept. 11, Mohammed was living in the southern city of Karachi, but was eventually captured in Rawalpindi, just outside of Islamabad.

Turning the screws, looking for leads

A snapshot of a dazed and disheveled Mohammed was shown around the world in the aftermath of his capture on March 1, 2003.

That would be the last time that the public would see Mohammed's face for several years, as U.S. intelligence moved him to a series of secret prisons and worked him over for information.

For the entire first month of his captivity, Mohammed was subjected to waterboarding.

Miniter said Mohammed's interrogators got him to a point where he "knew the penalty of non co-operation," in which he began to crave the routine that resulted when he worked with his interrogators.

It was a process that Miniter says helped U.S. intelligence slowly drain the high-ranking al Qaeda operative of many secrets that put the public at risk.

"I think they absolutely need him," said Miniter, who believes that Mohammed remains a valuable resource for intelligence, even after the death of bin Laden.

Mohammed's many interrogration sessions gave the U.S. valuable information about developing plots against landmarks and infrastructure around the world, which Miniter said included plans to attack the Brooklyn Bridge and Empire State Building in New York; the former Sears Tower in Chicago; Seattle's Space Needle; the Panama Canal; London's Heathrow airport; and U.S. embassies in Paris and Bamako, Mali.

But they also get information on a name that eventually would help the U.S. deliver what President Barack Obama would describe as the "most significant achievement" in the decade-long war against al Qaeda: the death of bin Laden.

Cracking the secrets of al Qaeda

It's not precisely clear when Mohammed confirmed the courier's name for his interrogators.

Miniter has been told by some sources that they got the name as early as 2005, while he has seen other accounts that it came out about two years later.

"It takes a long time," said Miniter, describing the difficulties interrogators face in teasing out the secrets of an organization like al Qaeda, in which members normally do not know the real names of their fellow members.

"The way I understand the story from someone who was briefed on this, they showed KSM (Mohammed) a line drawing of a face and said: ‘Do you know who this is?'" Miniter said.

Mohammed indicated that he did know the face, which he identified by giving "the only name he knows," the secret code name of the courier.

"And then he adds: ‘Oh, but he's not very important, I wouldn't bother about him, in fact, I think he's quit al Qaeda, you know I think he's gone,'" said Miniter.

His reaction made it obvious that his interrogators had something look into.

"Because he was so agitated about the name, they became more curious," Miniter said.

"But it took them a long time to develop more information about the courier."

Through interviews with other detainees, Miniter said they probed further about the courier, who has been identified in the wake of bin Laden's death as Sheikh Abu Ahmed -- a Pakistani man who went by the nom de guerre Abu Ahmed al-Kuwaiti.

Mohammed was one of several high-ranking al Qaeda members that U.S. officials checked the name with, a strategy which ultimately helped them track down bin Laden.

It's this type of inside information Mohammed holds within his brain, which Miniter believes makes him a valuable resource for U.S. intelligence both now and in the future.

With files from The Associated Press