MOGADISHU, Somalia – African Union troops fought house-to-house battles with militants Thursday to clear space for aid groups bringing in food supplies, after intelligence reports showed insurgents reinforcing for a possible attack on squalid camps of famine refugees.

Heavy fighting erupted on the line of control between the government side and territory held by al-Shabab, Somalia’s dominant militant group.

At least six people were killed. The AU troops also paid a heavy price, with one official saying 19 were wounded.

Somalia’s famine is unfolding in the middle of a war zone, greatly complicating international efforts to prevent a wave of death. Some 2.2 million people live in an inaccessible famine zone controlled by the al-Qaida-linked al-Shabab.

Thursday’s house-to-house fighting was only 21/2 miles from the nearest famine refugee camp, said Lt. Col. Paddy Ankunda, spokesman for the African Union peacekeeping force.

The offensive, he said, was to ensure the city streets are safe for aid groups to get humanitarian supplies to the more than 20,000 famine refugees that have arrived in Mogadishu this month alone.

“The agencies have been trying to deliver. Unfortunately, al-Shabab has been bent on ensuring this aid does not reach the people,” Ankunda said. “This operation is about the delivery of humanitarian aid.”

Al-Shabab’s decision last week to rescind permission allowing aid groups to operate in areas under militant control has denied hundreds of thousands of Somalis access to food aid, he said.

Ankunda added that al-Shabab has sent 300 reinforcement fighters to Mogadishu in recent days.

Refugees have said militants already killed men who tried to flee famine-hit regions of Somalia with their families, saying it is better to starve than accept help from the West. African Union intelligence reports have indicated there could be attacks on Mogadishu’s patchwork of ad-hoc refugee camps.

Thursday’s battle was a “short, tactical offensive operation,” Ankunda said. “This action will further increase security … and ensure that aid agencies can continue to operate to get vital supplies to internally displaced,” he said.

Mogadishu resident Mohamed Hussein said al-Shabab fighters had withdrawn shortly after the offensive began.

“We have captured most of the bases we attacked … and our troops are still chasing them,” said Abdullahi Ali Anod, a Somali military commander.

Troops from the African Union Mission in Somalia, known as AMISOM, have been eroding al-Shabab’s territory all year. Ankunda said the government now controls more than 60 percent of Mogadishu, up from around 40 percent at the beginning of the year.

AMISOM will keep humanitarian organizations informed of future operations to limit the impact on famine relief efforts, he said.

“AMISOM fully understands the need to restrain military operations while the aid agencies mount their humanitarian campaign. However, we are here to maintain stability in Mogadishu, and if we perceive a threat from the extremist insurgents, then it is our duty to protect and defend the most vulnerable from this threat,” he said.

The World Food Program operations were being conducted normally, said spokeswoman Challiss McDonough.

“The airlift plans have not been affected at this point,” she said. “Our humanitarian mission remains unaffected and unchanged.”