Five Al-Shabaab militants are dead after they attacked an African Union military base in Somalia on Thursday, AU officials said. 

The militants attacked the Halane military base in Mogadishu, Somalia's largest base for African Union troops, according to the African Union Mission in Somalia. 

Two militants detonated themselves inside the Halane base and three were shot dead by AU troops during the raid, AMISOM spokesman Ali Aden Houmed said. 

Three AU soldiers and a civilian died in the attack, AMISOM said on its website. 

The AMISOM statement said other personnel at Halane are "safe and secure." Some of the attackers wore Somali military uniforms during the lunchtime raid on the facility located close to Mogadishu International Airport, the AU said. 

A spokesman for the al Qaeda-linked terror group described the attack on the heavily fortified base -- which also houses several U.N. and international agencies -- on Radio Andalus, a pro-Al-Shabaab broadcaster. 

"Our Mujahedeen forces detonated a car bomb at the entrance of the Halane compound ... then managed to enter the facility," Sheikh Abdiaziz Abu Musab said. A firefight then broke out with troops, he said. 

Maman S. Sidikou, special representative of the AU Commission chairperson (SRCC) for Somalia and head of AMISOM, offered his condolences to the families of the victims and "applauded the quick response and bravery of the ... troops in quelling this reprehensible attack," according to AMISOM. 

Al-Shabaab has been waging war in Somalia in an effort to implement a stricter form of Islamic law, or sharia. 
Who is starting the fight?
Al-Shabaab militants