Amid the crisis, Mr. Goel, now a senior South Asia Fellow at the New America Foundation, paid little attention to the sources of the intelligence and said that he still knew little about specific operations. But two things stood out, he said: The main conspirators in Pakistan had already been identified. And the quality and rapid pacing of the intelligence reports made it clear that electronic espionage was primarily responsible for the information. “During the attacks, it was extraordinarily helpful,” Mr. Goel said of the surveillance.

But until then, the United States did not know of the British and Indian spying on Mr. Shah’s communications. “While I cannot comment on the authenticity of any alleged classified documents, N.S.A. had no knowledge of any access to a lead plotter’s computer before the attacks in Mumbai in November 2008,” said Mr. Hale, the spokesman for the Office of the director of National Intelligence. As N.S.A. and GCHQ analysts worked around the clock after the attacks, the flow of intelligence enabled Washington, London and New Delhi to exert pressure on Pakistan to round up suspects and crack down on Lashkar, despite its alliance with the ISI, according to officials involved. In the stacks of intelligence reports, one name did not appear, Mr. Goel clearly recalls: David Coleman Headley. None of the intelligence streams from the United States, Britain or India had yet identified him as a conspirator.

The Missing American

Mr. Headley’s many-sided life — three wives, drug-smuggling convictions and a past as an informant for the United States Drug Enforcement Administration — would eventually collapse. But for now, he was a free man, watching the slaughter on television in Lahore, Pakistan, according to his later court testimony. At the time, he was with Faiza Outalha, his Moroccan wife, having reconciled with her after moving his Pakistani wife and four children to Chicago.

Mr. Headley’s unguarded emails reflected euphoria about Lashkar’s success. An exchange with his wife in Chicago continued a long string of incriminating electronic communications by Mr. Headley written in a transparent code, according to investigators and case files. “I watched the movie the whole day,” she wrote, congratulating him on his “graduation.”

About a week later, Mr. Headley hinted at his inside information in an email to fellow alumni of a Pakistani military school. Writing about the young terrorists who carried out the mayhem in Mumbai, he said: “Yes they were only 10 kids, guaranteed. I hear 2 were married with a daughter each under 3 years old.” His subsequent emails contained several dozen news media photos of the Mumbai siege.

Almost immediately, Mr. Headley began pursuing a new plot with Lashkar against a Danish newspaper that had published cartoons of the Prophet Muhammad. He went to Denmark in January and cased the newspaper, meeting and exchanging emails with its advertising staff, according to his later testimony and court records. He sent messages to his fellow conspirators and emailed himself a reconnaissance checklist of sorts, with terms like “Counter-Surveillance,” “Security (Armed?)” and “King’s Square” — the site of the newspaper.

Those emails capped a series of missed signals involving Mr. Headley. The F.B.I. conducted at least four inquiries into allegations about his extremist activity between 2001 and 2008. Ms. Outalha had visited the United States Embassy in Islamabad three times between December 2007 and April 2008, according to interviews and court documents, claiming that he was a terrorist carrying out missions in India.