The attack is the first time that Somalia's government troops, backed by African Union peacekeeping soldiers, has moved out of Mogadishu and taken the fight directly into al-Shabaab strongholds.

It follows months of relative stability in the capital since the Islamists retreated in August last year, and shows that al-Qaeda's affiliate on the Horn of Africa is again on the back foot, analysts said.

Hundreds of soldiers on Wednesday pushed closer to the town of Afgoye, northwest of Mogadishu, where up to 400,000 people who fled their homes are squatting on al-Shabaab-controlled land.

The militants' commanders have banned most international aid groups from working in their territory, despite the ongoing effects of last year's famine and threats of further severe hunger after failed crops this year.

"Once the security situation has stabilised, we hope to see that people will have the opportunity to return to their homes and humanitarian services will be available to them," said Wafula Wamunyinyi, head of the AU's force in Somalia.

There were concerns that fighting in such a crowded area, known as the Afgoye corridor, could lead to ordinary people being caught up in the conflict, or Islamist fighters melting into the local population.

"At this stage, we have no reports of significant movements of people from the corridor," said Mark Bowden, the United Nations humanitarian coordinator for Somalia.

"However, I remain concerned that an escalation of hostilities or a prolonged operation could lead to displacement, further straining the capacity of settlements and host communities in Mogadishu or driving people away from the life-saving help they require."

Lieutenant General Andrew Gutti, AMISOM's Force Commander, said that the attack had been "designed to minimise the harm to the population".

"During this joint operation AMISOM is taking every precaution to prevent harm or injury to civilians," he said.

Abdisamad Moalim Mohamoud, Somalia's interior minister, said that government forces had made "a great achievement" during the first day of the offensive, taking the towns of Garasbaley and Daynile from al-Shabaab.

But Islamist commander Sheikh Fuad Mohamed Khalaf told Mogadishu's Radio Al Andalus that "the crusade forces and their Somali puppets launched an offensive, they were pushed back, they were given a lesson enough".

Reports that al-Shabaab had killed senior AU officers and Western military advisers could not immediately be verified.