Major Bahoku Barigye, spokesman for the AU peacekeepers, confirmed the clashes but said the attackers did not directly target peacekeeping forces.

"They attacked ex-control where local [pro-government] militants are stationed, it is very close to our base, but it was not directly aimed at our forces," he was reported by the AFP news agency as saying.

Weak government

The Somali government has been losing ground in recent weeks and now controls little more than the centre of Mogadishu, with the support of AU troops.

In depth

 Profile: Sharif Ahmed
Timeline: Somalia
Restoring Somalia
A long road to stability
Al-Shabab: Somali fighters undeterred
 Somaliland: Africa's isolated state

Hizbul Islam, a Somali opposition group fighting government forces and AU peacekeepers, seized Mahaday, a town north of the capital, on Monday.

A day earlier, fighters from Al-Shabab, another anti-government group, captured the nearby town of Jowhar.

As fears grew of the government's inability to combat the fighters, the Ethiopian government denied reports that its troops had crossed into Somalia.

But Hussein Mohammed Noor, a Somalia analyst, rejected the Ethiopian claims, insisting that Ethiopian troops were operating in Somalia.

"Ethiopia is inside Somalia right now, whether it crosses from the border or whether it denies ... that doesn't make any difference," told Al Jazeera.

Ethiopian troops originally entered the country in 2006 to restore the UN-backed government to power, but agreed to pull out of Somalia at the start of 2009 as part of a peace deal.

As the violence escalates, Somalia is suffering a growing humanitarian crisis, with thousands of refugees flocking to overcrowded makeshift camps and the country facing its worst drought in ten years.