Pakistan-born David Headley told court he would appear as prosecution witness if he was pardoned over 2008 attack.

A court in the Indian city of Mumbai has pardoned an American national of Pakistani origin, as part of a possible deal allowing him to give evidence about his involvement in the 2008 Mumbai attacks.

David Headley appeared in court on Thursday via video link from the United States, where he is serving a 35-year jail sentence for his role in the attacks that killed at least 166 people, and for conspiring to attack a Danish newspaper.

Headley earlier told the court he would appear as a witness if he was pardoned.

READ MORE: Mumbai suspect speaks of ‘Pakistan role’

The court agreed to Headley’s plea and asked him to disclose all the information he had revealed to the US court, local media reported.

“The court’s decision to agree to such a deal is significant. The prosecution hopes Headley helps to more clearly connect the attacks to Pakistan,” said Al Jazeera’s Nidhi Dutt, reporting from New Delhi.

Headley testified in the Mumbai court in accordance with his agreement with the US government that he would participate in foreign judicial proceedings.

Indian police want to question Headley about the alleged involvement of Pakistani army and intelligence officials in the attacks that left 166 people, including six Americans, dead in the Indian metropolis.

Headley has confessed to being a member of Lashkar-e-Taiba (LeT), the Pakistani armed group behind the attacks. He went on scouting trips to Mumbai, making videos of buildings that were targeted in the three-day siege.

Headley, who was earlier questioned by Indian federal investigators, said three senior Pakistan army officers played a key role in the attacks, media reports said.

During a separate 2011 trial against Tahawwur Rana, a Pakistan-born Canadian citizen, Headley described his initial contacts and training with LeT on repeated trips to Pakistan. He said he was introduced to a retired Pakistani military officer at a mosque.

He also said that the LeT fighters consulted with Pakistani intelligence (ISI) officials on a number of matters.

“These groups operated under the umbrella of ISI … they co-ordinated with ISI,” Headley testified under questioning by prosecutor Daniel Collins.

Pakistan has repeatedly denied involvement.

Seven men, including Lashkar operations commander Zaki-ur Rehman Lakhvi, are currently undergoing trial in Pakistan.

In 2012, India executed the only surviving gunman, Ajmal Kasab, who was given the death sentence by the Indian courts.