The clash triggered a four-hour battle.
Ali Araf, a tailor in the area, said he counted the bodies of eight people, adding that he was slightly wounded during the battle in which both sides pounded each other with mortars.
Ali Muse, the head of Mogadishu's ambulance service, said his group had counted six other bodies and took about 40 wounded people to dfferent hospitals.
Sheikh Ali Mohamoud Rage, al-Shabab's spokesman, said the attack was in retaliation for the recent killing of senior al-Qaeda commanders in Iraq.
"We have carried out a holy suicide attack against the enemy of Allah in Mogadishu today and we destroyed the bank building where they were stationed," Rage said.
"This attack was a retaliation for the killing of our mujahedin brothers Abu Omar al-Baghdadi and Abu al-Masri ... in Iraq."
The 5,000-strong AU force, with troops from Uganda and Burundi, is regularly targeted by al-Shabab fighters who have vowed to overthrow the transitional government.
Last September, 17 peacekeepers were killed in twin bombings at the forces' headquarters in the deadliest attack on the AU since it arrived in Mogadishu in early 2007.
Al-Shabab and its Hezb al-Islam allies have restricted Ahmed's government control to just a few streets in the capital since launching an onslaught last year.