Three men accused of training and fighting with an al-Qaida offshoot operating out of Somalia have pleaded guilty to terrorism charges.

The three entered the pleas Tuesday in federal court in New York City.

Prosecutors had called the defendants "dangerous and influential" members of al-Shabab who trained to become part of an elite unit of suicide bombers. They were captured in Africa while traveling to Yemen before being brought to the U.S. to face charges here.

The three had previously pleaded not guilty. A trial had been scheduled to start next month.