CHICAGO - David Coleman Headley revealed more potentially damaging details Tuesday in alleging close cooperation between a Pakistani extremist group and Pakistan's top intelligence agency, testifying that he frequently exchanged e-mail messages and met with members of both groups a month before the deadly 2008 attacks in Mumbai.

Headley took the stand for a second day as the government's star witness at the federal terrorism trial of Tahawwur Rana, a Chicago businessman and longtime Headley friend who is accused of collaborating in the three-day siege of India's largest city. Rana has pleaded not guilty.

Headley, a former Philadelphia resident, alleged how he was recruited by a member of Pakistan's Inter-Services Intelligence agency to take part in the Mumbai plot and provided a rare glimpse into what he says were the inner workings of the Pakistani extremist group Lashkar-e-Taiba.

Boat crash

He told jurors he met with both his handlers from Lashkar and ISI in Pakistan in October 2008 - a month before the Mumbai rampage that killed 164 people, including six Americans. He testified that his Lashkar contact, Sajid Mir, said extremists had unsuccessfully tried to carry out the attack that September but had crashed their boat leaving Pakistan. They also talked for the first time about a separate plot to attack a Danish newspaper that in 2005 had printed cartoons of the Prophet Muhammad, he said.

"I suggested we only focus on the cartoonist and the editor," Headley testified about a later meeting with Mir. "He said, 'All Danes are responsible for this.' "

Headley's testimony outlining links between the ISI and Lashkar could inflame tensions between Pakistan and India and place even more pressure on the frayed U.S.-Pakistani relationship.

Pakistani denials

It also could add to questions about Pakistan's commitment to catching extremists and about ISI connections to Pakistan-based terror groups, especially after Osama bin Laden was found this month hiding in a military garrison town outside Islamabad.

Headley, a Pakistani American whose mother was a Main Line socialite, pleaded guilty last year to scouting targets for the Mumbai attacks. He agreed to testify against Rana.

Pakistan's government has denied that the ISI orchestrated the Mumbai attacks, and a senior ISI official speaking on condition of anonymity said Tuesday that the agency had no links to those behind the rampage.

When the attacks took place, Headley testified, he got a text message from Mir asking him to turn on the television.

"I was pleased," he told jurors, but later he started to worry: "I was concerned if our plan had been leaked out."