MUMBAI - An American who helped plot deadly attacks in Mumbai told a court Monday that militants made two failed attempted attacks on the Indian city before killing 166 people in November 2008.

David Headley, who was sentenced in 2013 by a Chicago court to 35 years in a US prison for his role in the atrocity, said Lashkar-e-Taiba (LeT) militants had been behind the fatal assaults.

"In the month of September 2008 and in October 2008 those attempts by the LeT were unsuccessful on account of accident to the attackers," said Indian public prosecutor Ujjwal Nikam, citing Headley's testimony via video link.

India has long blamed the LeT for the coordinated attacks on November 26, 2008 when the gunmen stormed luxury hotels, the main railway station, a Jewish centre and other sites in the country's financial capital.

The attacks, which lasted for three days, have been a consistent source of acrimony between India and Pakistan as New Delhi has called for Islamabad to bring the alleged masterminds to justice.

Headley, 55, was giving evidence to a special Indian court from an undisclosed location in America. The court is trying suspected plotter Sayed Zabiuddin Ansari, also known as Abu Jundal.

In December it pardoned Headley on condition that he testified to the court. The pardon does not affect the US sentence. Headley, the son of a former Pakistani diplomat, was sentenced after admitting scouting targets for the Mumbai attackers.

He spent two years researching sites, even taking boat tours around the city's harbour and befriending Bollywood stars as part of his cover.

After initially denying involvement, Headley confessed and cooperated with US authorities to avoid the death penalty. Nikam said Headley had told the Indian court he had joined the LeT in 2002 and received two years of "military training", including "in handling sophisticated weapons like AK47s"