Somalia's Al-Qaeda linked Shebab insurgents have been forced from almost all key towns by African Union forces, fighting alongside Somali government troops and other militia opposed to the extremists.
But the fighters remain a powerful force in Somalia, demonstrating their ability to strike at the heart of the most secure areas in the country by their brazen daylight attack on a key United Nations compound on Wednesday.
The seven-man suicide commando, first using car bombs and suicide attacks to blast their way into the compound before starting a gun battle to the death, followed similar bloody tactics used in April, when they attacked a Mogadishu court house.
The coordinated attack on the UN killed 11, while 34 died in the raid on the courthouse.
Somalia's capital has been hit by a series of attacks including suicide and car bombings, mortar attacks and shootings, ever since the Shebab abandoned fixed frontline positions in Mogadishu almost two years ago.
The Shebab, meaning "youth" in Arabic, emerged out of the bitter insurgency fighting Ethiopia, whose troops entered Somalia in a 2006 US-backed invasion to topple the Islamic Courts Union that was then controlling the capital Mogadishu.
They impose their own radical version of Islamic law, including dress regulations and public mutilations, on the parts of the country they control.
They have also imposed draconian restrictions on foreign aid agencies operating in their zones, bans that saw them accused of exacerbating southern Somalia's devastating 2011-2012 famine.
Long active mainly in southern and central Somalia, large swathes of territory have been wrested from them by the 17,000-AU force fighting alongside government troops.
Ethiopian troops, who again invaded in late 2011 and who cooperate with AU troops, are also battling the Shebab.
Two key bastions fell in 2012: in February, the central town of Baidoa was seized by Ethiopian and Somali troops, while in October, Kenyan troops took the southern port of Kismayo.
The United States has offered multi-million dollar bounties for several top leaders, including $7 million for commander Ahmed Abdi Godane, and $5 million for Afghan-trained leader Mukhtar Robow as well also for two US citizens fighting with the Shebab.
But the group is riven by multiple factions, some based along regional and clan lines, as well as ideological, with some attracted by a nationalist agenda to oust foreigners from Somalia, and others with international jihadi ambitions.
Given their scattered and fractured forces, it is hard to estimate the group's numbers.
Several foreign fighters have fought in the Shebab, many of ethnic Somali descent.
Key strongholds include rural southern and central Somalia, while another faction has dug into remote parts of the northern Puntland region, in the rugged Golis mountains.