In this courtroom sketch, David Coleman Headley, 52, left, appears before U.S. District Judge Harry Leinenweber at federal court in Chicago, Thursday. Pic: AP.

CHICAGO (AP) — An American was sentenced to 35 years in prison for helping plan a 2008 terrorist attack on Mumbai, escaping a life sentence because prosecutors pressed for leniency as credit for his widespread cooperation with U.S. investigators after his arrest.

The judge sounded reluctant about imposing the lesser sentence on David Coleman Headley in a Chicago courtroom Thursday minutes after one of the victims tearfully pleaded for harsh punishment for the attack that has been called India’s 9/11.

(READ MORE: India: 35-year term not enough for Mumbai plotter)

Prosecutors said they wanted Headley to get no more than 35 years because he provided intelligence about terror networks, including the Pakistani-based group that mounted the attack. Rewarding Headley with the hope of at least a few years of freedom, the said, would encourage future suspects in terrorist cases to spill their secrets.

A somber Judge Harry Leinenweber imposed the lesser sentence but said the Mumbai assault was so unfathomable and terrifying that, “perhaps the lucky ones were the ones who didn’t survive.”

“I don’t have any faith in Mr. Headley when he says he’s a changed person and believes in the American way of life,” he said.

Headley’s meticulous scouting missions facilitated the assault by 10 gunmen from a Pakistani-based militant group.

The attackers arrived by boat on Nov. 26, 2008, carrying grenades and automatic weapons, and fanned out to hit multiple targets, including a crowded train station, a Jewish center and the landmark Taj Mahal Hotel. TV cameras captured much of the three-day rampage live.

Headley, 52, shifted uncomfortably in a gray tracksuit and kept his eyes fixed on the courtroom floor as he listened to an American children’s author describe the violent chaos during her 2008 vacation to India.

Bullets flew past her check and panicked diners dived under tables as gunmen burst into a hotel restaurant, then walked around executing people one by one, recalled Linda Ragsdale, at times almost shouting as she stood just near Headley during the sentencing hearing.

“I know the sweet sickening smell of gunfire and blood,” said Ragsdale, 53, who was shot through the back — the bullet passing along her spine and then out her thigh. “I know what a bullet can do to every part of the human body … These are things I never needed to know, never needed to experience.”

She did not comment after the judge imposed the sentence, but others victimized by the attack said they were disturbed and upset Headley did not get the maximum life sentence he faced. With credit for good behavior, he could walk out of prison before he turns 80.

“He lost his right to live life as a free man. He doesn’t deserve to be let out. He gave up that right when he played a role in the attack,” said Kia Scherr, whose husband Alan Scherr and 13-year-old daughter, Naomi, were at the same table as Ragsdale and died.

Ragsdale, the only victim to address the court during Thursday’s hearing, also read a text message from Kia Scherr to the judge, in which Scherr implored the court not to give Headley less than life in prison and asserting that anything less “would be an appalling dishonor.”

The attack heightened the strain in a historically antagonistic relationship between India and Pakistan, which have fought three major wars. Indian officials accuse Pakistani intelligence of helping to plan the assault — an allegation Pakistan denies.

Ragsdale painted a detailed picture of the gory scene as she huddled under the table with Scherr’s husband Alan and her daughter, Naomi. After the initial gunfire, they were all still alive, and she said she would have thrown her body across the teen to shield her.

“That moment still haunts me,” she said, crying, as she looked straight at Headley. She said she passed out from her injuries under the table and “awoke to hear Naomi take her last breath.”

Headley showed no emotion when the sentence was announced. Earlier, when the judge asked if him if he wanted to address the court, he leaned forward and said politely, “No your honor, I expressed everything in the letter I wrote you.”

That letter was not read in court, but defense attorney Robert Seeder — without offering specifics — told reporters afterward that Headley used the note to explain “what led him to this and how sorry he was.”

Prosecutors say Headley, who was born in the U.S. to a Pakistani father and American mother, was motivated in part by his hatred of India going back to his childhood. He changed his birth name from Daood Gilani in 2006 so he could travel to and from India more easily to do reconnaissance without raising suspicions.

He never pulled a trigger in the attack by the Pakistani-based militant group, Lashkar-e-Taiba, but he videotaped and mapped targets for the gunmen.

Prosecutors also have praised Headley for testifying against Tahawwur Rana, the Chicago businessman convicted of providing aid to Lashkar and backing a failed plot to attack a Danish newspaper for publishing depictions of the Prophet Muhammad. Rana, sentenced last week to 14 years in prison, claimed his friend Headley duped him.

Prosecutors have recounted only in broad terms how Headley has shed light on the leadership, structure and possible targets of Lashkar-e-Taiba, which was believed to have ties to the Pakistani intelligence agency known as ISI. Headley has said his ISI contact was a “Major Iqbal,” who was named in the indictment that charged Headley.

For his cooperation and guilty plea, Headley secured both a promise that he would not face the death penalty and would not be extradited to India. Late last year, India secretly hanged the lone gunman who survived the Mumbai attack, Mohammed Ajmal Kasab.

The 12 counts Headley pleaded guilty to included conspiracy to commit murder in India and aiding and abetting in the murder of six Americans, who included Americans Alan and Naomi Scherr.

After the attack, Kia Scherr helped start an organization called the One Life Alliance, which seeks to work against terrorism by promoting understanding and respect for the sacredness of life.

She wrote in an email Thursday from Mumbai that she has thrown herself into doing charity work in the city.

“This is how I am surviving this event, which erased life as I knew it,” she said.