MOGADISHU, Somalia—A top official from this country’s al-Qaeda-linked terrorist group who was among Washington’s most-wanted terrorist suspects was apprehended, a senior Somali defense official said.

Zakariya Ismail Ahmed Hersi, a Somali national, is described by the U.S. government as a key figure behind a number of deadly attacks carried out by al-Shabaab. Those included a double bomb attack in Kampala, Uganda, in July 2010 that left more than 70 people dead, including one U.S. citizen. Washington had offered a $3 million...