Al-Shabab militants attacked a base used by Kenyan and US forces on Sunday, killing three Americans.
This follows a deadly attack at the end of December, when at least 79 people were killed in a car bomb in the Somali capital, Mogadishu.
So, is the situation deteriorating, and what impact is US military involvement having?
President Trump’s administration has vastly increased aid and military engagement in Somalia, where al-Shabab have been most active, since assuming office in 2017.
The US administration has made it a priority in its global effort to defeat Islamist terrorism, increasing the use of airstrikes and drones to combat the militants.
This surge has been accompanied by a change in the classification of parts of Somalia to “areas of active hostilities”, which means commanders don’t need high-level approval to conduct strikes.
US airstrikes in Somalia
“Encouraged and supported by the government of Somalia, precision airstrikes support our partner security forces’ efforts to protect the Somali people from terrorism,” a spokesperson for the US military in Africa told the BBC.
The US military conducted more airstrikes in 2019 than in any previous year.
However, while it’s difficult to assess the true impact of airstrikes, experts, former officials and an analysis of local media reporting suggest that the group’s hold on its territory remains strong.
There is also a concern that civilians are being caught up in the conflict.
Casualties of US airstrikes
Amnesty International has published findings that the US strikes have killed people who are not part of militant groups, although the US military maintains its targets have been al-Shabab militants.
Analysts say that civil society, previously generally supportive of airstrikes, has been strained by the sheer frequency of attacks that are now taking place.
So has the US surge been effective?
Al-Shabab still retains control over large areas of rural Somalia and continues to mount attacks in urban centres.
Most of these have occurred in Mogadishu and the Lower Shabelle region close to the capital.
There have been few attacks in the north of the country, although to the north-east, some groups loyal to the so-called Islamic State are active.
In recent years it has changed its approach from direct military confrontation, to destabilisation tactics, such as bombings, raids and assassinations of Somali and international officials.
It has also continued to be successful in generating revenue from local clans, collecting taxes and running courts outside government-controlled areas.
“Al-Shabab has largely been physically removed from most of the main population centres but its influence in cities and towns is possibly increasing once again,” says Michael Keating, the former head of the United Nations Assistance Mission in Somalia (UNSom) from 2016 to 2018.
The Somali government doesn’t publish statistics on militant killings.
However, the Armed Conflict Location & Event Data Project (Acled) collects data on al-Shabab attacks, using local and international sources.
Al-Shabab conflict in Somalia
This indicates that 2019 is already one of the highest years on record for fatalities from al-Shabab attacks.
This is just below the figure for the whole of 2017, during which more than 500 people were killed in one attack in Mogadishu involving two lorry bombs.
The government attributed this attack to al-Shabab, although the group did not confirm it was behind it.
BBC Monitoring’s specialist team monitoring jihadist activity estimates the number of al-Shabab militants to be somewhere in the region of 5,000-7,000.
“You cannot bomb your way to peace in Somalia. If the violence is going to be reduced there clearly needs to be a political process that allows people to talk to each other, rather than just shoot and kill,” says Mr Keating.
A US state department official told the BBC it remained the largest single international donor to Somalia and was committed to stabilisation in the country.
And what about al-Shabab activity against Kenya?
Since 2011, when Kenya sent troops to fight al-Shabab in Somalia, the group has carried out frequent attacks on its soil.
In January last year, 21 people were killed during a raid on the DusitD2 hotel complex in the capital Nairobi.
The group’s deadliest attacks on Kenyan soil was in April 2015 when gunmen attacked the Garissa University College in eastern Kenya killing 148 people, most of them students.
In recent months, the group has also been targeting public transport buses along the eastern region which neighbours Somalia and the coast.
Kenya had been on high alert over the Christmas and New Year holiday period, following intelligence reports that al-Shabab could carry out attacks.