When Najibullah Zazi pleaded guilty to being the ringleader in a foiled plot to bomb New York City's subway system, U.S. Attorney General Eric Holder said he was responsible for "one of the most serious terrorist threats to our nation" since the 9/11 attacks.

Nearly a decade later, Zazi has a shot at an improbable second chance.

The 33-year-old is finally scheduled to be sentenced Thursday in federal court in Brooklyn, and prosecutors are expected to credit him with switching sides after his arrest and volunteering valuable intelligence about other al-Qaeda trained terrorists. The cooperation could earn him a far lighter term than the possible life sentence he faces. It might even give him a chance at freedom.

The full extent of Zazi's cooperation has yet to be publicly disclosed. Both prosecutors and his attorney declined to be interviewed in advance of the sentencing hearing.

But some elements of his assistance with U.S. counterterrorism efforts have become public through his testimony in other terror prosecutions.

Prosecutors on Wednesday filed a court document crediting Zazi with implicating his two best friends in the subway plot and providing "critical intelligence and unique insight regarding al-Qaeda and its members."

The document said Zazi's "extraordinary" cooperation included meeting with the government "more than 100 times, viewing hundreds of photographs and providing information that assisted law enforcement officials in a number of different investigations."

"Zazi's assistance came in the face of substantial potential danger to himself and his family," Assistant U.S. Attorney Douglas M. Pravda wrote in the court filing. "By aligning himself with the government against al-Qaeda, Zazi assumed such a risk."

Zarein Ahmedzay, a fellow conspirator in the New York City subway bombing plot who also decided to help American investigators, also faced up to life behind bars but was sentenced last year to 10 years — essentially time served.

Seamus Hughes, deputy director of George Washington University's Program on Extremism, predicted Zazi would also get "considerably less" than a life sentence.

Prosecutors at the Brooklyn U.S. Attorney's office "tend to look favorably on cooperation when it comes to terrorism cases," he said. And the lengthy lag between Zazi's guilty plea and sentencing, Hughes added, "speaks to the value that prosecutors saw in terms of Zazi testifying against others."

Born in Afghanistan, Zazi moved to Pakistan as a child and then relocated to New York City as a teenager.

At age 14 he was living in Queens, where his father drove a cab. Friends said he initially seemed to like American life. He became a naturalized U.S. citizen and took a job operating a coffee cart on Wall Street.

Fellow food vendors said Zazi changed, though, after a series of trips back to Pakistan. He grew a long beard, stopped wearing western clothes in favor of tunics and began playing holy music. He also ran into financial problems, declaring bankruptcy in 2008.

Not long after that, Zazi and two childhood friends from Queens— Ahmedzay and Adis Medunjanin — agreed to travel to Pakistan in 2008 to try to join the Taliban. Instead, they were recruited by al-Qaida operatives for a "martyrdom operation" on U.S. soil.

The plot called for the three men to conduct suicide bombings on subway lines during rush hour near the eighth anniversary of the Sept. 11 terror attacks.

Zazi, who had moved to a Denver suburb and briefly worked as an airport shuttle driver, later said he wanted to "bring attention to what the United States military was doing to civilians in Afghanistan by sacrificing my soul for the sake of saving other souls." He cooked up explosives in a Colorado hotel room, made from a recipe of beauty supplies.

Secretly, though, the FBI had gotten tipped off that Zazi was involved with militants. He was placed under surveillance in Colorado and followed as he drove to New York, where police stopped his car as it entered the city. Officers let him go, but his rental car was later towed by the FBI.

Zazi was further spooked by a call from a Queens imam warning police were asking about him. He rushed back to Colorado. FBI agents executed a series of raids. News outlets learned of the investigation and also began hounding Zazi, who told reporters he had no idea what was going on. He was soon arrested.

Following his 2009 arrest and decision to cooperate, Zazi testified against Medunjanin in the subway plot, providing a tearful account that prosecutors said was "critical to establishing proof of Medunjanin's understanding of and participation in the conspiracy to kill American soldiers in Afghanistan and to conduct a suicide attack on the New York City subways."

In 2015, he gave critical evidence in the trial of Abid Naseer, a Pakistani national convicted of leading an al-Qaeda plot to bomb a shopping mall in Manchester, England.

Zazi also played a role in the prosecution of Muhanad Mahmoud al-Farekh, a U.S. citizen born in Texas who was convicted of supporting al-Qaeda and conspiring to bomb a U.S. military base in Afghanistan.

Other would-be terrorists have been able to gain their freedom by cooperating with prosecutors.

American Al-Qaeda recruit Bryant Neal Vinas, who spent years providing investigators with details on militant activities after he was arrested in 2008 in Pakistan, was sentenced to time served — about eight years — and released in 2017.

Medunjanin's decision to go to trial rather than plead guilty like Zazi and Ahmedzay came at a heavy cost: He's now serving a life sentence at the "Supermax" prison in Florence, Colorado.