The attack occurred as the recruits lined up to enlist outside the home of a senior general near a military camp in Aden's Khor Maksar district, officials said.

The port city serves as the temporary capital of Yemen's Saudi-backed administration while it seeks to seize back Sanaa from the Iran-allied armed Houthi group that took it in 2014, plunging Yemen into civil war.

Local news website Aden al-Ghad showed pictures of soldiers picking up bloodied comrades in uniform from the ground and witnesses said ambulances with blaring sirens collected the wounded.

Islamic State said the attack targeted "the apostate Yemeni army" and named the attacker as Abu Ali al-Adeni, according to a statement posted on its social media accounts.

It said a bomb planted at the gate of the nearby Badr army base detonated afterwards. Officials said the second blast caused no casualties.

The attacks follow gains by Yemeni government forces backed by the United Arab Emirates, who mounted an offensive on al Qaeda militants in southern towns last month.