The AU's Burundian and Ugandan troops went into Somalia in 2007
At least 15 people have been killed and 90 injured during the fiercest fighting in the Somali capital Mogadishu since a new president was elected last month.
The battle focused on the south of the city, with rebels firing mortars at the presidential palace and a base for African Union and government troops.
It came as Eritrea said all foreign troops must leave Somalia if national reconciliation was to be achieved.
Meanwhile Burundi vowed to send more peacekeepers to the AU mission.
Burundian Defence Minister Lt Gen Germain Niyoyankana told Radio France Internationale they planned to reinforce their presence with a battalion of 850 men as soon as possible.
The minister said his government would not be deterred by Sunday's suicide attack - claimed by the radical al-Shabab group - which left 11 Burundian peacekeepers dead at a barracks in Mogadishu.
In Tuesday's fighting insurgents fired volleys of mortar bombs at the heavily-guarded hilltop presidential palace in the Wardhigley district of Mogadishu.
The BBC's Mohammed Olad Hassan in the capital says the newly-elected President Sheikh Sharif Sheikh Ahmed was understood to be at home at the time.
Our correspondent says it is the fiercest fighting since the moderate Islamist leader was elected late last month under a UN-brokered peace deal.
Insurgents also bombarded a base for AU and government troops in the Hodan district, while untargeted mortars rained down on the nearby Howlwadag district.
But our correspondent adds it was civilians as usual who bore the brunt of the battle, during which heavy machine gun fire was exchanged.
One resident, Abdirizak Mohamed, told Reuters news agency: "A mother and her baby died after a shell landed on their house. Their flesh was so mangled we did not know what to carry."
The Islamic Party, a coalition of four insurgent Islamist groups, said its fighters had been involved in the fighting but blamed the government, which it said had sought to exert control over new areas.
Meanwhile the Eritrean foreign ministry said in its statement: "Putting an end to invasion and external interference is a precondition for the realisation of the Somali people's aspirations to reconstitute their nation.
Al-Shabab vowed to focus attacks on the AU after Ethiopian troops left
"It is equally imperative to get rid of any force deployed in Somalia under the pretext of 'peacekeeping mission'."
Several Somali Islamist groups have operated out of Eritrea since they were ousted from Mogadishu after Ethiopian troops went in just over two years ago.
Ethiopian troops, which had been in the country since 2006 to support Somalia's fragile transitional government, pulled out at the end of January.
The AU's 3,400-force of Burundian and Ugandan peacekeepers - deployed since 2007 - are now the only foreign troops in the Somali capital.
Somalia has not had a functioning national government since 1991.
Some three million people - half the population - need food aid after years of fighting.