Witnesses reported hearing gunfire and explosions at the base, which has a tight security cordon and blast walls, near the city's airport. It is also used as a base for U.N. operations in Somalia. The airport area also houses the British and Italian embassies.
Aleem Siddique, spokesman for the United Nations in Somalia, told Reuters all U.N. staff were safe and accounted for.
The Islamist militant group al-Shabab has claimed responsibility for the assault.
An al-Shabab spokesman said al-Shabab fighters had forced their way onto the base, where gunfire was continuing, but their claim could not be verified. AU officials could not be reached for comment.
Details on casualties was not available.
Thursday's attack came a day after Somalia's parliament endorsed a new prime minister, appointed last week after the war-torn country's president fell out with the previous premier amid bitter infighting.