Maj Gen Fred Mugisha said the militant al-Shabab group still threatened stability in Mogadishu and troops were needed to protect food aid.
The government has said it is offering amnesty to the group’s fighters.
Somalia has been hit by 20 years of conflict, while a famine has gripped parts of the country since June.
Al-Shabab controls most of south and central Somalia, including Lower Shabelle and Bakool, the regions worst affected by the famine.
On Saturday, it surprised many analysts by announcing a withdrawal of its forces from Mogadishu.
Gen Mughisha said al-Shabab had not withdrawn completely and pockets of insurgents remained in the city.
“About 90%-95% of Mogadishu has been liberated, creating areas for starving people to access food,” he said.
Click to play
Former Senator Bill Frist recently visited Kenya and told the BBC what he sees as the most urgent needs
“But the city is not as calm as we would like it to be.”
The BBC’s Mohamed Mwalimu in Mogadishu says al-Shabab fighters launched an overnight attack in the city on two fronts.
However, they retreated after AU and government forces returned fire, our reporter says.
‘Air and sea power’
Gen Mugisha said the AU needed an immediate deployment of 3,000 troops to bolster its 9,000-strong force and help the UN-backed government.
It also needed air and sea power to secure Mogadishu and the rest of Somalia before “millions perish from the famine”, he said.
It could be that a totally different military situation is being created”
End Quote Augustine Mahiga UN Somalia envoy
Last year, the UN Security Council approved a 12,000-strong AU force for Somalia, although the AU said it needed 20,000 troops.
Several African countries, including Nigeria and Malawi, have failed to fulfil promises to send troops because they fear being dragged into the long-running conflict.
All the current troops are from Uganda and Burundi.
Al-Shabab, which is affiliated to al-Qaeda, was formed in 2007 to overthrow the weak interim government and establish Islamist rule in Somalia.
The UN special envoy to Somalia, Augustine Mahiga, said he supported the deployment of more AU troops.
“Both [the AU force] and government forces need to be resupplied and resupplied quickly in terms of manpower and equipment to re-establish authority in those areas [surrendered by al-Shabab],” he told the BBC’s Focus on Africa programme.
Mr Mahiga said al-Shabab was likely to wage guerrilla warfare in Mogadishu, including carrying out more suicide bombings.
“It could be that a totally different military situation is being created,” he said.
Somalia’s President Sheikh Sharif Sheikh Ahmed is on a regional tour to bolster support for his government.
He is due to meet Tanzania’s President Jakaya Kikwete on Tuesday, following a meeting on Monday with Uganda’s President Yoweri Museveni.
The government held a ceremony on Tuesday in Mogadishu’s commercial hub, the Bakara market, to announce that police would take over security at the market from the army.
The government’s decision shows it is confident that al-Shabab is on the retreat in Mogadishu, our reporter says.
The market had been heavily contested for months and many shops – which closed because of the fighting – are reopening, he says.
The government has promised militants that they will not be punished if they surrender.
“Put down your weapons and your guns, and come and join the people and your society,” government spokesman Abdirahman Osman was quoted by the AFP news agency as saying.
The UN refugee agency on Monday flew aid to drought victims in Mogadishu, its first airlift to the city for five years.
Some 100,000 people have arrived in the city in the last two months in search of food.
Many aid agencies were banned by al-Shabab in 2009 and they fear their workers could be targetted if they return to the country.