The AU says that three peacekeepers and five Islamist gunmen were killed in the ensuing battle, which saw the gunmen infiltrate the base in Mogadishu.
Sheikh Ahmad Umar Abu Ubaidah has replaced slain Al-Shabab leader Ahmed Godane, who was killed in a US air strike.
Militant group al-Shabab has claimed responsibility for an attack which the United Nations has called an "attack against the people".
Al-Shabab says "Western" forces attacked a house in one of its coastal bases in the town of Barawe under the cover of dark, killing one rebel fighter.
At least 16 people were killed as two car bombs exploded outside the law courts in Somalia’s capital Mogadishu and gunmen stormed the building.
No image available
/ 31 December 2011
Ethiopian troops and clan militia fighters forced al-Qaeda-linked militants to flee a Somali town after heavy clashes on Saturday.