Somali militant group Al Shabab claimed separate attacks on a US military base and a European Union convoy in the East African country on Monday.
A bomb attack in the morning was followed by small arms fire at a base operated by US special forces in the Somali town of Baledogle.
"In the early hours of Monday morning, an elite unit of soldiers from Harakat Al Shabaab Al Mujahideen's Martyrdom Brigade launched a daring raid on the US military base," an Al Shabab press release said.
"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 Balidogle base is in the Lower Shabelle region, about 100 kilometres west of the capital Mogadishu. It is a major launching site for US drone operations against Al Shaabab, an Al Qaeda-linked group which controls large parts of Somalia, and the Islamic State in Somalia outfit.
In a separate attack, a security official said EU advisers training the Somali National Army were also attacked by a car bomb in Mogadishu.
"There was a car bomb targeting the EU military advisors along the industrial road. A vehicle loaded with explosive was rammed onto one of the convoy vehicles and there are casualties," said Omar Abikar, a Somali security officer.
The vehicle had been bearing a small Italian flag sticker. Italy's defence ministry said in a statement that an Italian military convoy had been hit by an explosion. No injuries had been reported so far, the defence ministry said.
The attacks are the latest in a long line of bombing and assaults claimed by Al Shabaab.
The jihadists were driven out of Mogadishu by government forces backed by 20,000 African Union peacekeepers in 2011. But they still carry out attacks including suicide bombings against government targets.