Chicago: A Chicago man admitted Thursday that he scouted out the Indian city of Mumbai for a 2008 terrorist attack that left 166 people dead and plotted an attack on a Danish newspaper over cartoons depicting the Prophet Mohammad (PBUH).

David Coleman Headley, a 49-year-old American citizen, pleaded guilty in US District Court to all 12 counts he faced. Under a deal with prosecutors, Headley will not face execution if he continues to cooperate with their terrorism investigation. He could face up to life in prison and a $3 million fine when he’s sentenced. A date has not been set.

His attorney, Robert Seeder, said after the hearing that Headley’s decision to talk was “a manifestation and example of his regret and remorse,” and wasn’t based solely on the fact that he will avoid a possible death sentence. “He has provided significant help to the United States and aided other countries,” said Seeder. He declined to specify what help Headley had provided.

In his plea agreement, Headley admitted that he made surveillance videos and conducted other intelligence gathering for the November 2008 attack on Mumbai. Nine of the 10 gunmen were also killed in the three-day siege.

The US and India say the gunmen were trained and directed by the Pakistani-based terrorist group Lashkar e Taiba.

Headley also said he met with a Pakistan-based terrorist leader, Ilyas Kashmiri, in a tribal area of western Pakistan in May 2009, and that Kashmiri told him he had a European contact who could provide Headley with money, weapons and manpower for an attack on Denmark’s Jyllands Posten newspaper.

That attack never happened.

He said men he knew as “elders,” whom he understood to be leaders of Osama Bin Laden’s Al Qaida terrorist network, urged swift action in attacking the newspaper, which offended many Muslims in 2005 by publishing a dozen cartoons depicting the Prophet Mohammad (PBUH).

He said Kashmiri wanted newspaper employees beheaded and the heads thrown from the building to send a message to the Danish authorities.

Headley said Kashmiri said it should be a suicide attack, and that the attackers should prepare martyrdom videos.

According to the indictment, Kashmiri has been in regular communication with Al Qaida’s No. 3, Shaikh Mustafa Abu Al Yazid.

In court Thursday, Headley wore a prison-issued orange jumpsuit as a dozen federal marshals stood watch.

Spectators were walked through a metal detector and women’s purses sniffed by a police dog.

Headley spoke softly in a British accent when asked by US District Judge Harry Leinenweber if he was pleading guilty of his own free will.

Attorney General Eric Holder said in a statement from Washington that “not only has the criminal justice system achieved a guilty plea in this case, but David Headley is now providing us valuable intelligence about terrorist activities.”

“As this case demonstrates, we must continue to use every tool available to defeat terrorism both at home and abroad,” Holder said.

Headley could have been sentenced to death if convicted of the most serious charges – conspiracy to bomb public places in India and six counts of murdering US nationals in India – but the death sentence is “off the table” if Headley continues to cooperate, said Seeder.

That could include testifying against his co-defendant, Tahawwur Hussain Rana, if he goes to trial. Rana, a 49-year-old Canadian co-defendant who lived in Chicago, has pleaded not guilty to conspiracy to provide material support to terrorism in Denmark and India, as well as to Lashkar-e-Taiba.

Messages seeking comment were left for Rana's attorney, Patrick Blegen.

Retired Pakistani military man Abdur Rahman Hashim Syed and Kashmiri are also accused in the plot against the Danish newspaper. Their exact whereabouts are unknown.