MOGADISHU - Islamist rebels armed with mortars and machine guns attacked African Union forces in Somalia's capital Mogadishu overnight, sparking a battle that killed at least nine people, officials and residents said on Tuesday.

The al Shabaab militants, who are allied to al-Qaida, were forced out of most of the city last year but have kept up sporadic bomb and suicide attacks.

"It was heavy fighting last night ... Two al Shabaab dead bodies are lying here," said Captain Ndayiragije Come, a spokesman from the Burundi contingent of the AU's AMISOM peacekeeping mission in Somalia.

"From our side two were injured. They were also shelling our position - they missed their target," he added.

Witnesses said shelling from the fighting hit two houses, killing at least seven civilians, four of them from one family.

"A big shell landed on a house made of iron sheets. The father, mother and their two sons died, only two children survived with injuries," resident Abdi Gaas told Reuters.

Please LIKE our Facebook page - it makes us stronger