NEW YORK (CBSNewYork/AP) — An al Qaeda member from Yemen pleaded guilty on Tuesday to U.S. terrorism charges that included accusations he helped an American recruit join the terrorist group — clearing the way for the local native to hatch a plot against the Long Island Rail Road.

Ali Alvi al-Hamidi admitted in U.S. District Court in Brooklyn that he traveled to Pakistan in 2008 to get military training from al Qaeda and fight alongside the Taliban against U.S. forces in Afghanistan.

He faces a possible life term at sentencing on June 3.

The plea demonstrated an “unwavering commitment” by U.S. authorities “to bring to justice those who fight against U.S. forces or assist al-Qaeda and others in their efforts to kill Americans at home or abroad,” U.S. Attorney Robert Capers said in a statement.

Al-Hamidi, 31, and another Yemeni recruit had been detained in Saudi Arabia before being brought to the United States early last year to face charges they conspired to kill Americans and provide material support to al Qaeda. The charges stemmed from information supplied to investigators by Long Island native Bryant Neil Vinas, who was captured in 2008.

The three “became close associates — while they lived together at the safe house,” court papers said. The Yemeni suspects later introduced Vinas, nicknamed Ibrahim or Bashir al-Ameriki, to senior al Qaeda members who agreed to give him weapons and other training, the papers said.

Over time, al Qaeda leaders grew to view Vinas as a valuable asset because of his American passport and knowledge of transit systems and other potential targets within the United States, prosecutors said. At a 2012 trial of a man accused in a thwarted plot against New York City subways, Vinas testified how he suggested to others in al-Qaida in the summer of 2008 that they could plant explosives in a suitcase aboard a Long Island Rail Road train or hide them inside a television that was being returned to a Wal-Mart.

An attack on the popular retail outlet “would cause a very big economy hit,” he said. The attacks were never attempted.

After his capture, Vinas was taken to federal court in Brooklyn, where he pleaded guilty in 2009 and agreed to testify against terror defendants in U.S. cases. There has been no sentencing date set for Vinas as he continues to cooperate.

(TM and © Copyright 2016 CBS Radio Inc. and its relevant subsidiaries. CBS RADIO and EYE Logo TM and Copyright 2016 CBS Broadcasting Inc. Used under license. All Rights Reserved. This material may not be published, broadcast, rewritten, or redistributed. The Associated Press contributed to this report.)