An American-born al-Qaida member turned informant will be freed from federal prison after providing valuable information to U.S. authorities.

A federal judge in New York sentenced Bryant Neal Vinas on Thursday to the time he has already served — more than eight years — plus three months. The 34-year-old native New Yorker will be on probation for the rest of his life.

"To say that the defendant provided substantial assistance to the government is an understatement," prosecutors wrote in court filings. "He may have been the single most valuable cooperating witness" in several al-Qaida-related cases.

The information Vinas provided about al-Qaida in Pakistan and Afghanistan helped identify suspected terrorists, their hideouts and disrupted plots.

Vinas was in the U.S. Army for a few weeks in 2002, two years before he converted to Islam. He traveled to a lawless part of Pakistan in 2007 and signed on with militant groups, since he had become "increasingly angered by what he perceived to be the persecution of Muslims by Western countries," his lawyers wrote in court papers quoted by The Associated Press.

After briefly being considered as a suicide bomber by a splinter extremist group in North Waziristan, Vinas joined al-Qaida, the terrorist group responsible for the 2001 attacks on the United States. He was captured by Pakistani authorities in 2008, who turned him over to the United States, and he quickly became a willing informant.

Vinas admitted taking part in a rocket attack on U.S. soldiers across the border in Afghanistan, and prosecutors said al-Qaida leaders used his knowledge of New York City to plot an attack on the Long Island Rail Road. The plan to detonate a bomb as a train traveled through a tunnel beneath a river was never carried out.

Much of what Vinas told U.S. intelligence about al-Qaida remains secret, but his testimony as a witness helped convict three terror suspects who plotted to bomb the New York City subway in 2009, U.S. officials said.

Defense attorneys said Vinas "will spend the rest of his life with a target on his back" as a result of information he divulged about terrorist activities. Prosecutors agreed his cooperation put his life at risk, and they asked the judge to reward him with a minimal sentence. They added, however, that Vinas still needs supervision, mental health care and vocational training.