CHICAGO — The government’s leading witness in a high-profile terrorism trial told jurors here Monday that the group behind the 2008 attack on Mumbai, India, had ties to Pakistan’s intelligence service.

In testimony that prosecutors said offered a “rare look” inside a major terrorist plot, David C. Headley said he had trained with the Islamist militant group Lashkar-e-Taiba between 2002 and 2005 in preparation for scouting locations to attack in India. In 2006, Mr. Headley said, he met a member of Pakistan’s Inter-Services Intelligence Agency who offered to provide financial support for that surveillance.

In testimony so painstaking that the judge and some jurors seemed to nod off at the mundane details of a plot that left 163 people dead, Mr. Headley described how he changed his name and used his American passport to portray himself alternately as a tourist or a businessman, concealing his Muslim faith and his Pakistani roots so he could travel easily across borders. He said he provided hours of video of potential targets in Mumbai to his handlers in both ISI and Lashkar.

“I understood these groups operated under the umbrella of the ISI,” he said, referring to Lashkar. “They coordinated with each other.”