"An AMISOM base was attacked by several mortar shells tonight," Col. Mohamed Maalin, a Somalia Police Force member, told The Anadolu Agency.
"Some of the shells hit the AMISOM compound, while others landed in the ocean," he added.
He said the attacked base was the fortified Halane base in the Somali capital Mogadishu, by far the largest AMISOM military base in Somalia.
Around 200 suspected Al-Shabaab members were rounded up in Mogadishu earlier on Sunday.
Maalin said the shelling came from the direction of Wajid district, southwestern Somalia.
"This is the work of Al-Shabaab," he added.
"They killed 10 soldiers and burnt two military vehicles (equipped) with anti-aircraft guns."
Sheikh Abdiasis Abu Musab, Al Shabaab's military spokesman, said the group was behind the attack and said 14 Somali soldiers had been killed. Al Shabaab often cites a higher death toll than the number given by officials.
Somalia has remained in the grip of on-again, off-again violence since the outbreak of civil war in 1991.
Earlier this year, the country appeared to inch closer to stability after government troops and African Union forces – deployed in the country since 2007 – drove Al-Shabaab group from most of its strongholds.