“The Ethiopian force is attacking the militants, who are retreating in disarray,” he added.

The Ethiopian army also captured and destroyed a cache of weapons, which included heavy machine guns, RPGs, and anti-aircraft guns, Tewolde said.

In a statement posted on social media, AMISOM also confirmed the dawn attack.

"We can confirm there was an attempted Al-Shabaab attack on the AMISOM/SNA [Somali National Army] base in Halgan, Somalia. The enemy was successfully repulsed," AMISOM said.

“AMISOM troops and SNA jointly drove back the attackers, who are now on the run with the joint forces in pursuit [in] Halgan, Somalia. An assortment of weapons has been captured as the joint forces overpowered the attackers. More details to follow.”

A senior AMISOM official who spoke to Anadolu Agency on condition of anonymity due to restrictions on speaking with the media denied Al-Shabaab’s claims to have killed more than 40 soldiers.

Residents of Somalia’s Halgan district, in the central Hiran region, posted on social media that they heard a loud explosion followed by heavy gunfire coming from the direction of the Ethiopian military base.