Jihadists have attacked a military base where US soldiers train commandos in Somalia.
Local residents reported heavy blasts and gunfire at Baledogle airport in the southern Lower Shabelle region.
The al-Shabab militant group said it had carried out the attack, using a car bomb to blast through the gates before sending its fighters inside.
Military officials say the jihadists were repulsed without breaching the perimeter fence.
No casualties were reported among the Somali military.
In a statement, US Ambassador Donald Yamamoto praised the Somali military for their "alertness and swift response".
"This attack yet again demonstrates al-Shabab violently opposes progress towards peace and prosperity in Somalia," he said.
Al-Shabab said in a statement it had launched the raid, adding: "After breaching the perimeters of the heavily fortified base, the mujahideen [holy warriors] stormed the military complex, engaging the crusaders in an intense firefight."
The base, about 100km (60 miles) west of the capital Mogadishu, is said to house US special forces, Somali special forces and Ugandan peacekeepers. It is used as a launch site for US drones as well as being a training centre.
US Somali operation shrouded in secrecy
By Mary Harper, BBC World Service Africa editor
The fact that al-Shabab managed to attack two foreign targets in a single day proves its enduring power, 13 years after it came into existence. It shows it is a well-coordinated force, with a sophisticated intelligence network.
The assault on the US military training base at Baledogle airport will be an embarrassment to the Americans, who have stepped up drone attacks on al-Shabab since Donald Trump became president.
The US military is also active on the ground in Somalia, training an elite group of Somali commandos known as The Shield and taking part in special operations, always shrouded in secrecy.
Al-Shabab seems impervious to the multitude of forces ranged against it, from thousands of African Union troops, to Western and other foreign special forces, to a large if fractured Somali army.
The group does far more than stage attacks on its enemies. It imposes fines and taxes, even in government-controlled areas. It provides effective - if brutal - judicial services, which are as popular with those living outside the areas it controls as those inside them.
It is essentially a governing force, and is likely to remain so until the Somali government and its allies form a credible, functioning alternative.
Read more from Mary:Somalia's network of Islamist spies
Separately, an Italian military convoy was hit by an explosion in Mogadishu itself, Italy's defence ministry said. No casualties have as yet been reported in this attack.