A push by security forces in Somalia to stop Al Qaeda-linked Shabab has cost the extremist group some territory and leaders.
But the group has proved resilient. So although as of Monday the Shabab had not claimed responsibility for the weekend truck bombing in Mogadishu that killed more than 300 people, the attack resembled others by the group, and Somali authorities were sure the Shabab was responsible.
The enduring enigma about the Shabab is how the group has remained so tenacious, retaining support in some areas of Somalia despite a series of deadly attacks on civilians going back years. Mogadishu, the capital, has been hard hit:
A Dec. 3, 2009, suicide bombing on a medical students’ graduation ceremony at a hotel, which killed 25
An Oct. 4, 2011, truck bomb attack on students waiting for exam results outside the Education Ministry, which killed 70
A Jan. 21, 2016, car bomb and gun attack on a seafood restaurant at Lido beach, which killed 20
A Jan. 25 car bomb and gun attack this year at a hotel, which killed 28
Who would join a group that bombs civilians?
Mohamed Yahya, program coordinator with the U.N. Development Program, recently interviewed young Shabab recruits who had been captured and imprisoned in Galkayo, northern Somalia, for a report on why young men in Africa are drawn to extremist groups. The total number of Shabab members is difficult to know, but officials estimate group membership of at least several thousand people.
When Yahya asked one 19-year-old Shabab recruit whether he went to a government school, the young man had no idea what a government school was. In his region, the government did not provide schools, clinics or welfare services.
UNDP interviewed 495 recruits to extremist groups in various African conflicts. The report, Journey to Extremism in Africa, released last month found that people were less likely to be recruited if they were well educated, including religious education.
Yahya said the Somali recruits had grown up surrounded by conflict, in regions beset with poverty and hunger. Their experience of the state was often limited to harassment or discrimination by security forces, or perhaps the arrest or killing of a relation or friend.
"In the African context recruitment is very localized and it happens in what we call ungoverned spaces, areas where the state has little presence, services are not present, education is very low, both religious and secular education," Yahya said.
"Any potential recruiter to these kinds of groups finds an opportunity for willing young people who are either marginalized or feel a sense of grievance. In the Somali context what is very interesting is that most recruitment happens in minority clans. It happens in groups that come from the periphery in their own country."
Yahya said it was important to disrupt recruitment by meeting the needs of the Somali population for health, welfare and education.
"I work with the U.N. and we were shocked about how much we are not present in these peripheral borderlands," he said. "In the long run development has to reach these areas and people have to feel that they have opportunity."
Seventy-one percent of the 495 recruits said the final tipping point that motivated them to join an extremist group was some form of government harassment or abuse.
"If you want to deal with violent extremism, you really have to do something about how government acts. Of course security has to play a role, but it has to work within the norms and due processes of human rights. If you don't, then we're never going to get out of this cycle of destruction. Human rights, the rule of law and due process is actually a prevention factor."
Special forces and drone strikes have been used against the Shabab. But can they defeat the group?
The Shabab has been under intense pressure this last year from attacks by U.S. drones and special operations forces. But the group still operates freely in many parts of Somalia's rural hinterlands.
The Shabab maintains the capacity to recruit fighters in the vast areas of the country where the central government is largely absent except for military checkpoints where security forces harass civilians and extort money.
In March, President Trump approved wider powers for U.S. forces in Somalia, enabling forces to conduct offensive strikes if there was a reasonable certainty no civilians would be hurt.
"We have seen a significant increase in terms of drone strikes and special operations strikes since Jan. 20," said E.J. Hogendoorn, analyst with the International Crisis Group.
"I think the increased tempo will continue to contain Al Shabab, in that it will continue to undermine the ability of the group to rebuild. I don't think it will be enough to defeat the group," he said. "While the group has suffered some significant setbacks it remains very resilient."
Why is it difficult to defeat the Shabab?
One of the biggest barriers to the defeat of the Shabab, according to analysts, is Somalia's dysfunctional and corrupt government and security. The country is ranked worst of any country in Transparency International's corruption perceptions index.
Somali authorities have been content to rely on the United Nations-backed African Union Mission in Somalia, or AMISOM, to do the heavy lifting in the fight against the Shabab, and on the international community to deal with the country's humanitarian emergencies.
As the country weathers its worst drought in decades, more than 6 million people are in need of humanitarian assistance. A massive international humanitarian response averted famine this year.
Somalia's central government has little presence outside the capital. Efforts by AMISOM to stabilize the country and help Somali forces gain control over regional towns have often failed.
"Rural areas are contested and Al Shabab is able to operate relatively freely in Somalia's hinterland," Hogendoorn said. "The Somali federal government has made very little progress in bringing the government back to areas outside Mogadishu."
The Shabab has been tenacious because it retains some support in rural areas by providing basic services, security and law enforcement, Hogendoorn said.
"That doesn't mean that their government is better, but Al Shabab applies much more consistent rule of law than the government. Most ordinary people may not be happy with the beheadings and chopping off of arms, but at least there's not as much predation by security forces," Hogendoorn said.
He said Somalia's "rapacious elite" was often more interested in continuing to steal than stabilizing the country.
"There are people in the Somali government who want to reform and do the right thing," he said. "Their efforts are stymied by a band of spoilers who have been doing this for a very long time and who know how to manipulate the international actors."