(CNN) Nearly 10 years after Najibullah Zazi pleaded guilty to plotting to bomb the New York City subway system, a federal judge in Brooklyn said he would effectively serve no additional prison time after prosecutors cited Zazi's "extraordinary cooperation" with US investigators.

"Is this the same Mr. Zazi I saw so many years ago?" US District Court Judge Raymond Dearie asked during Zazi's sentencing in May, after prosecutors and defense counsel described his transformation from al Qaeda-linked would-be terrorist to valuable government witness. "All indications are, it is not."

Zazi pleaded guilty in 2010 to three charges connected to a plot to bomb the subway around the anniversary of the September 11 terrorist attacks, including conspiring to use weapons of mass destruction, conspiracy to commit murder in a foreign country and providing material support to a terrorist organization.

Since then, prosecutors said in court filings, he has proven a remarkably helpful cooperator, having met with the government more than 100 times, testified in multiple trials and "provided critical intelligence and unique insight regarding al Qaeda and its members."

An evolution in prison

Zazi had faced a maximum term of life in prison. Dearie sentenced him to 10 years on all three counts. With Zazi having already served more than nine years in prison, his lawyer expected him to be released within days of his sentencing. Today, he's free but under strict lifetime supervision.

Najibullah Zazi

"I tried my best to correct my horrific mistake by cooperating with the government," Zazi said in court this spring.

His head was shaved, with little hint of the beard he once had. "I am not the same person," he said. "I find it almost hard to imagine what I was involved in in 2008 and 2009."

He said that though he had failed to finish high school, while in prison he received his general education diploma and "took every class available." "I did not waste any opportunity," he said.

"I'm very sorry, your honor, for all the harm I have caused," he said. "And I ask for forgiveness."

His attorney, William Stampur, who has represented Zazi for nearly 10 years, said his client's evolution included his "repudiation of any terrorist ideology."

JUST WATCHED When the word 'marriage' also means 'attack' Replay More Videos ... MUST WATCH When the word 'marriage' also means 'attack' 00:49

"He has unequivocally disavowed radical Islam in no uncertain terms," Stampur said.

And Assistant US Attorney Douglas Pravda, while describing Zazi's crimes as "as serious as it gets," said Zazi, in his conversations with prosecutors, had recognized how he had been "manipulated" into adopting al Qaeda ideology.

The judge wondered aloud at several points whether to accept that Zazi had truly completed the sweeping transformation his attorneys and the prosecutors described.

"Too much suffering, tragedy has come to this country by terrorists who claim to do their evil work in the name of God," Dearie said.

But he ultimately said Zazi's assistance to the government, described in court documents the judge said were "unprecedented, in my experience," had earned him leniency.

"This once unthinkable second chance has come your way," Dearie said.

Letter to judge: 'living the American dream'

"Coming to America was the greatest moment in my life," Zazi, who moved to the United States from Pakistan when he was 15, wrote in a undated letter to the judge.

In the letter, Zazi outlined his radicalization as well as his reformation.

He wrote that upon immigrating, he became "a die hard fan of all the New York teams" and "supported America's declaration of war against Afghanistan" following the 9/11 attacks on the World Trade Center.

But in 2007, he wrote that he met two men who "seduced" him with the teaching of Anwar-Al-Awlaki on the internet. The teachings led Zazi to believe, he wrote, that "the United States was on a mission to destroy all of Islam" and that "if [he] did not act to protect Islam [he] would be doomed forever in the afterlife."

Zazi cited getting his G.E.D. in prison and gaining a new understanding of the Quran in changing his perspective.

"The uneducated are perfect targets for the unscrupulous," the letter said.

A plot to bomb a New York City subway

Zazi, an Afghanistan native who had been living in Colorado, was arrested in September 2009 after having driven to New York with materials to build bombs.

In the years prior, he had traveled to Pakistan and "conspired with others to join the Taliban, to fight along with the Taliban against the United States," Zazi said at his guilty plea in 2010. "We were recruited to al Qaeda instead."

According to prosecutors, Zazi and two others had gone to Pakistan "to wage jihad (violent struggle) against American and coalition forces in Afghanistan."

At a terrorist training camp in northwest Pakistan's Waziristan region along the Afghan border, Zazi "had discussions with al Qaeda about targets including the New York City subway system," he disclosed during his plea proceeding.

JUST WATCHED In 2009, police tracked an 'imminent threat' before 9/11 Replay More Videos ... MUST WATCH In 2009, police tracked an 'imminent threat' before 9/11 00:38

He had learned how to make explosives at the camp, he said at the time, and had emailed himself bombmaking instructions to use once he returned to the United States. He took several trips to New York for planning purposes before making the final trip from Denver on September 10, 2009, to carry out the plot, according to statements he made at his plea.

But Zazi, who had been under surveillance by federal authorities for months before his arrest, wasn't alone. Agents had followed him as he drove from Denver to New York. After Zazi arrived, he and his co-conspirators realized they were being investigated, and threw away their bombmaking materials.

The US attorney general at the time of the foiled plot, Eric Holder, called it "one of the most serious threats to our nation since September 11, 2001" and said upon Zazi's arrest that "there is no doubt that American lives were saved."

Cooperation 'in the face of potential danger'

In their sentencing submission, prosecutors gave Zazi credit for encouraging his father, Mohammed Wali Zazi, who was indicted on charges connected to the subway bombing plot, to "accept responsibility and plead guilty for his actions." (His father instead went to trial, where he was convicted on two counts and later pleaded guilty to a third.)

Prosecutors also credited Zazi with having reviewed hundreds of photographs and "providing information that assisted law enforcement officials in a number of different investigations, even where Zazi did not personally know the subjects of those investigations."

Zazi, they wrote, cooperated "at great personal cost to himself and his family," and his help to investigators "came in the face of substantial potential danger" in the form of potential retaliation by al Qaeda.

While testifying against one of Zazi's co-conspirators, Adis Medunjanin, Zazi "broke down in tears," prosecutors noted, "reflecting the difficulty Zazi had testifying against a close friend."

At Zazi's sentencing, the judge remarked on the testimony he'd provided, saying that effort had underscored "what you've done for this government."

Dearie said that before the sentencing, he stood in his chambers and looked out the windows toward the spot where the World Trade Center towers once stood.

"I had the same thought I had when I first met you," the judge said. "How could this happen?"