Three Somali-born men pleaded guilty Tuesday to conspiracy to support terrorism for their role in an al Qaida affiliate that bragged about committing attacks in East Africa.

Just weeks before their trial was set to begin in Brooklyn federal court, Ali Yasin Ahmed, Madhi Hashi and Mohamed Yusuf entered guilty pleas for their role as part of al-Shabaab militant group, which has claimed responsibility for terror attacks that included assaults on a college and a shopping mall in Kenya that left as many as 217 people dead.