He was the convicted terrorist who switched sides from al Qaeda to become a prized US government cooperator.
But the judge who sentenced Bryant Neal Vinas faced a "difficult" decision - how to punish someone who had committed a crime yet turned against a terror network.
The man, also called Bashir al-Ameriki and born and raised in New York, became a Muslim convert and militant.
Vinas moved to an outlaw region of Pakistan and schemed with senior al-Qaeda members on how best to attack the Long Island Rail Road.
But he was captured in 2008 at a check point in Pakistan and flown back to the US where he became a key witness for authorities.
In a letter to District Judge Nicholas Garaufis, prosecutors wrote that once in custody, Vinas, 34, eagerly became what "may have been the single most valuable co-operating witness" in efforts to identify members of al Qaeda, pinpoint their hideouts and disrupt their terror plots in the late 2000s when the nation was still reeling from the September 11 attacks.
Last week, Vinas was sentenced in federal court in Brooklyn on charges he tried to kill American soldiers and provide support to al Qaeda before he was captured by Pakistani authorities.
During sentencing Judge Garaufis revealed why sentencing him was no easy feat.
"The juxtaposition of Mr Vinas's atrocious crimes and his remarkable post arrest co-operation is what makes the task of sentencing Mr. Vinas so difficult," he said.
Prosecutors didn't want to appear to be a soft touch with Vinas facing a life sentence over his threat to kill American nationals, The New York Times reported.
Vinas was sentenced to eight years with time served and will be released in 90 days.
However he will remain on probation for life.
Steve Zissou, who represented Vinas said the sentence was fair.
"He really did become the instrument of al Qaeda's destruction," he said.
The man who tried to kill US troops in Afghanistan and advised al Qaeda on potential bombing targets has spent eight years in solitary confinement.
But once his time is served he faces other issues including what to do now.
Sentencing him, Judge Garaufis granted leniency based on the valuable intelligence he gave US authorities, including giving up the identities and whereabouts of some of the terror network's operatives.
Authorities now face a challenge in protecting someone who's been credited with putting a target on his back by betraying ruthless terrorists.
Taxpayers will also have to foot the bill to rehabilitate him after years on the fringes serving on both sides of the law.
He himself suggested a career in counter-terrorism, but as a convicted criminal he will never get a security clearance.
According to The New York Times, al Qaeda felt the effects of his capture and decision to speak with authorities straight away.
Don Borelli, a former FBI supervisor who oversaw Vinas's case said his capture and decision to talk was a big deal.
"He allowed the government to gain critical insights into al Qaeda," he said.
"Having that insight allowed the US government to mount disruption operations."
Prosecutors haven't revealed details of classified FBI reports they gave to the judge to show the depth of co-operation which prompted security alerts on mass transit systems around New York City.
But in court papers, they said Vinas "did 100 interviews, reviewed approximately 1000 photographs and contributed to the opening and closing of more than 30 investigations."
Vinas also testified at the trial of one of three New York City men convicted in a foiled plot in 2009 to bomb the subways.
He also gave statements against French and Belgian defendants accused of going to Pakistan to join al Qaeda.
The government didn't recommend a sentence, but the defence argued the co-operation came at great risk and should be rewarded with a term of time served.
"While Mr Vinas cannot take back his mistakes, he has done everything in his power to make up for them, and as a result, he will spend the rest of his life with a target on his back," his lawyers wrote in court papers.
Vinas' family declined through his lawyers to talk about him. But court papers provide some glimpses of his background.
His parents divorced when was just 10 and he dropped out of the army after only a few weeks in 2002.
Born into the Catholic faith, Vinas converted to an extremist form of Islam in 2004.
After that, he "became increasingly angered by what he perceived to be the persecution of Muslims by Western countries" and decided to travel to North Waziristan (Pakistan) in 2007 to retaliate, court papers reveal.
After agreeing to become a suicide bomber for a splinter jihadist group, he was introduced to al Qaeda operatives, who had him train in explosives and heavy weapons.
He admitted participating in two rocket attacks on US forces.
The American-born recruit caught the attention of al Qaeda leaders who wanted to draw on his knowledge as a regular rider of the LIRR and the New York City subways, authorities said.
In the summer of 2008, Vinas recommended placing a suitcase bomb that could explode on a moving train, preferably inside the tunnel where a number of train lines converge on Manhattan, a scheme that apparently was never set in motion.
Vinas' lawyers call him "a complex individual now on the path to redemption," with hopes of becoming a counter-terrorism expert.
Prosecutors sound less hopeful, saying he still needs supervision, mental health treatment and vocational training.
Though he is no longer a terror threat, they wrote, it is difficult "to evaluate Vinas' current mindset ... because he has become increasingly withdrawn and less willing to communicate."