The narrative heard in federal court in Manhattan on Wednesday was an increasingly common one: a defendant from a faraway land claimed he was not an anti-American terrorist but rather someone who had become involved in his own country’s wars.

This time, the defendant was Mohamed Ibrahim Ahmed, a 38-year-old Eritrean. His lawyers have said that his earliest memories were of explosions and rebels, of running, hiding and being evacuated from his home in the 1970s during the bloody Ethiopian-Eritrean conflict.

More than three decades later, Mr. Ahmed sought to join the fight against Ethiopia by seeking military training from Al Shabab, a Somali group with ties to Al Qaeda that the United States had designated a foreign terrorist organization. He was arrested in Nigeria in November 2009 and brought to Manhattan in 2010 to face terrorism charges.

The case was widely watched as a potential test of the Obama administration’s strategy of interrogating terrorism suspects for both intelligence and law enforcement purposes. Mr. Ahmed pleaded guilty in June in Federal District Court to conspiring to provide material support to Al Shabab and to receive military-type training from it.