African Union and Somali government forces have launched a long-awaited assault on the al-Shebab stronghold of Afgoye.

The area, just west of the capital Mogadishu, is home to hundreds of thousands of people who fled previous fighting in the capital.

Residents reported intense clashes and heavy artillery fire on the outskirts of Mogadishu as tanks and troops pushed out in a pre-dawn attack from Deynile, a suburb of the capital.

"Several artillery rounds struck the KM13 area, and families who had remained in the area started fleeing," Deynile resident Muhidiin Adan said.

The African Union said the assault was a "carefully planned operation to bring security and stability to the people of the Afgoye corridor".

Fighting was reported to calm later in the day, and both sides are claiming success.

The AU said its troops made "good progress", while the Somali army said Shebab fighters fled ahead of the advancing soldiers.

"The remnants of the Al Qaeda militants have already suffered a major defeat and they have emptied their barracks in the area," said Mohamed Osmail, a Somali military official.

"The army cut off a key road on the outskirts of Deynile, which the enemy has been using when organising attacks and transporting fighters to undermine the security of the city, they are no longer there now."

Deynile commands access to the Afgoye corridor, an area which is controlled by the Shebab.

But in a posting on Twitter the Al Qaeda-linked group claimed its forces had repelled the attack.

"The Deynile battlefront is going down in the history of Somali jihad as the largest graveyard of the AU forces," the group tweeted.

In recent months thousands of civilians have left Deynile for the capital, ahead of the expected assault on Shebab bases, where many retreated to after pulling out of fixed positions in Mogadishu last year.

AU and Somali troops have made significant gains in recent months against Shebab militants, although the Islamists have switched to guerrilla tactics in Mogadishu, including a series of suicide and grenade attacks.

Somalia's weak and Western-backed transitional administration has until August to set up a permanent government, but the international community has expressed concern it is failing to meet key deadlines.

Fighting erupted in Somalia in the late 1980s, escalating into a brutal civil war following a 1991 coup, with rival militias, warlords and Islamist fighters battling ever since for control of the Horn of Africa nation.

The mandate of the transitional government has already been extended several times, and Western nations say it cannot be extended again.

It's a fundamental human yearning to be a part of something bigger than one's self, and maybe that's what drove my mate Ash to die, far from home, in a bloody foreign war against Islamic State, writes C August Elliott.