The would-be terrorist who plotted a bomb attack on New York City's subway on the anniversary of 9/11 will soon be a free man after being spared extra prison time by a judge on Thursday following just 10 years behind bars.

Najibullah Zazi was facing he possibility of life in prison when he was sentenced Thursday for plotting the attack in 2009.

He pleaded guilty in 2010 and, as part of that deal, was due to spend the rest of his life in prison but because of his 'extraordinary' help to authorities over the last decade, he will now go free.

He appeared in court on Thursday and said: 'I am sorry for the harm that I caused. I am asking for forgiveness.

'I tried my best to correct a horrible mistake. I am not the same person.'

A court sketch shows Najibullah Zazi appearing before a judge on Thursday where he was freed after serving 10 years behind bars

Najibullah Zazi, pictured in 2009, was sentenced on Thursday to 10 years behind bars for plotting to blow up the NYC subway. He has spent nine years in prison already and has cooperated with authorities on counterterrorism probes which means he may now go free sooner than expected

Zazi, 33, is a naturalized citizen who is originally from Afghanistan.

He trained under al-Qaeda in Pakistan, learning how to put together explosives, and drove from Denver to New York in 2009 with the intention of blowing up a subway car but was caught before he got there.

Authorities were already watching him and had followed his route.

Since being taken into custody, police say he has helped them by giving more than 100 interviews, reviewing photographs and informing on terror investigations.

In light of the help he has provided, a judge on Thursday agreed that he had adequately served his time.

It is unclear when he will be released but it is possible he may be released in a matter of days.

His attorney celebrated the result on Thursday and said that he was a changed man.

'Mr. Zazi, who I ment almost 10 years ago when he was a young man, has changed dramatically and I witnessed that transformation over the past approximately 10 years.

'He hopefully will be released in a short period of time,' William Stampur said.

He agreed with prosecutors that Zazi had gone above and beyond to thwart other plots.

The FBI are pictured raiding Zazi's home in Denver in 2009 after his arrest

Zazi and other radicalized friends plotted to carry out a series of attacks on the subway

Among the help he gave was implicating his two best friends in the subway scheme.

He cried when he had to testify against one of them.

Assistant U.S. Attorney Douglas M. Pravda wrote in the court filing: 'Zazi’s assistance came in the face of substantial potential danger to himself and his family.

'By aligning himself with the government against al-Qaeda, Zazi assumed such a risk.'

His attorney said he is 'extremely appreciative and thankful for what happened today.'