Last month, the alleged mastermind of the Sept. 11, 2001, attacks, Khalid Sheik Mohammed, walked into a military courtroom at Guantanamo Bay, Cuba, and tried to wreak havoc. He cracked jokes with his four co-defendants, ignored the judge when he addressed him and spent part of the proceedings reading a magazine. After a 13-hour arraignment, he refused to enter a plea.

KSM, as he is known, is equal parts clowning buffoon and evil genius. He cracks jokes one minute and holds courtrooms spellbound with his admissions the next. His ego is legendary. His original Sept. 11 plan included a media event. He wanted to hijack an additional plane, land it at a major U.S. airport and then, from the tarmac, explain to America why it was under attack. Osama bin Laden is said to have diplomatically called that part of the plot a little “too complicated.”

After nearly a decade in U.S. custody — including four years at CIA black sites, where the United States admits he was waterboarded — KSM doesn’t appear to have changed much. Although he has been out of the violent jihadi scene for years, he still considers himself the sun around which that world revolves. So much so that when the Red Cross visited him for the first time after his 2003 capture, KSM didn’t want to talk about waterboarding or the conditions of his confinement. Instead, his top priority was a photo shoot. He wanted the Red Cross to release a portrait of him with a proper long beard. Evidently, the picture released shortly after his capture (more about that later) — all threadbare T-shirt and wild hair — was driving him crazy.

With timing that most publishers can only dream about, two former investigative reporters for the Los Angeles Times, Terry McDermott and Josh Meyer, have released the ultimate primer for those following the Sept. 11 trial. “The Hunt for KSM” was years in the making, and the book not only seeks to decode KSM just as he is about to return to center stage, but also introduces readers to the three people in U.S. law enforcement who seemed to recognize the threat KSM presented before anyone else. Had the intelligence community understood his ties to al-Qaeda in a more timely fashion, the authors suggest, Sept. 11 might never have happened. Instead, as late as 2002, U.S. officials thought KSM was a freelancer and a jihadi financier, not a mastermind of terrorist plots.

As evidenced by the subtitle — “Inside the Pursuit and Takedown of the Real 9/11 Mastermind” — the book works from the assumption that KSM is guilty. That’s because what interests the authors more than his guilt or innocence is how a man from Baluchistan, Pakistan, managed to turn himself into nothing less than the Kevin Bacon of terrorism. Nearly every major plot leveled against the United States from 1990 until years after the 2001 attacks had fewer than six degrees of separation from KSM. Either his family was involved, or his financing network coaxed something along, or he himself played a key role. His nephew Ramzi Yousef dreamed up the 1993 World Trade Center bombing. A KSM intimate partly financed the nightclub bombings in Bali, Indonesia. And the early reconnaissance for a 1995 plot to blow up a dozen American-flagged jetliners over the Pacific, according to McDermott and Meyer, was done by KSM himself.

’The Hunt for KSM: Inside the Pursuit and Takedown of the Real 9/11 Mastermind, Khalid Sheikh Mohammed’ by Terry McDermott & Josh Meyer (Little, Brown & Co.)

“The key ingredient in the prospective airplane bomb was nitromethane,” the authors write, “which was inexpensive and readily available in the Philippines. Mohammed emptied the contents of fourteen contact lens solution bottles, taking care to not break the plastic seals on the bottles. He then refilled them with the nitro. He carried thirteen of the bottles in his carry-on bag on a flight to Seoul. . . . To test his ability to clear airport security while carrying a metal detonator, Mohammed carried a small metal bolt. He taped the bolt beneath the arch of his foot, then covered his foot with a sock. . . . He set off alarms at the security scanner and was asked to undress. This included his shoes, but not his socks, and he was passed through. He realized later that he had left a detailed plan for the attacks in his carry-on bag; it contained all twelve of the targeted flights as well as the time the bombs were intended to explode. Security officials didn’t notice the plan, but did ask why he was carrying so much contact lens solution. I found a great sale in Manila, he said.”

At various times during his captivity, KSM has confessed to a role in nearly three dozen plots. They ranged from aspirational — mulling the assassination of the pope and President Bill Clinton — to real horrors such as the murder of Wall Street Journal reporter Daniel Pearl. McDermott and Meyer write that KSM hadn’t initially been aware that the Pakistan bureau chief of the Wall Street Journal had been abducted by local hoods. “The kidnappers, panicked that they had gotten in over their heads, had contacted Al Qaeda colleagues of KSM, offering Pearl to them,” the authors write. “Al Qaeda offered $50,000 for him and, because it was in Karachi and Karachi was KSM’s territory, asked him to take possession of the prize.” The book has a grisly description of just how KSM killed Pearl.

“The Hunt for KSM” is most effective when it draws back the curtain on the man and his activities. It is less successful in its attempts to be a law enforcement procedural. The authors write that the 10-year search for KSM — from 1993 to 2003 — was driven by three people: FBI agent Frank Pellegrino, former New York Port Authority detective Matthew Besheer and a former FBI deputy legal attache named Jennifer Keenan. They alone seem to have recognized the danger KSM presented while the rest of the intelligence community focused on bin Laden. Pellegrino and Besheer traveled to more than 30 countries over eight years looking for KSM, much to the derision of their colleagues and the ire of their bosses. While the authors track them all over the Middle East and South Asia, the three law enforcement characters never really come to life. The trio comes off as dogged but not three-dimensional.

Clearly McDermott and Meyer believe that if KSM had been captured before 2001 — or if the intelligence community had appreciated his importance — the attacks might have been avoided. The inspiration for the attacks sprang, in part, from KSM’s earlier airliner plot over the Pacific. The tragedy is that KSM wasn’t captured until March 2003. An informant was sitting with him in Pakistan and excused himself just long enough to text U.S. officials a simple message: “I am with KSM.” Mohammed was captured hours later.

“A member of the CIA team had taken photos of KSM right after his capture, including one in which he looks into the camera, with his eyebrows raised nearly to his hairline,” the authors write. But apparently, the CIA didn’t think the photos were sufficiently unattractive. A CIA man in Washington “asked if there were any other photos available. The agent messed up KSM’s hair then took another photo. The result was the famous image of KSM — thickset, glowering, wild-haired, half dressed in his nightshirt — his first introduction to most of the rest of the world.”

KSM is expected to make another appearance in court Aug. 8.

Dina Temple-Raston is the counterterrorism correspondent for NPR News and the author of four books, including “The Jihad Next Door,” about six Upstate New York men who were among the first Americans to attend an al-Qaeda training camp and then return to the United States.


Inside the Pursuit and Takedown of the Real 9/11 Mastermind, Khalid Sheik Mohammed

By Terry McDermott and Josh Meyer

Little, Brown. 350 pp. $27.99