Those attacks demonstrate the extent of the threat that al-Qaida and its fellow travelers pose across the Middle East and Africa, one that's increasingly involving the United States in a largely secret war against a determined enemy.
Jihadists in Yemen and Somalia are in retreat but they remain deadly forces that have proved in the past that they are capable of regrouping in the face of adversity -- and shouldn't be written off.
Without U.S. support, it's unlikely that the two regimes concerned would be able to crush the Islamists. But right now the signs are that al-Qaida, in its various manifestations across the region, is making gains in the confused and bloody aftermath of the pro-democracy uprisings in the Arab world that toppled four dictators and apparently marginalized the Islamist zealots.
Somali President Hassan Sheik Mohamud, a newcomer to the murderous politics of his war-ravaged Horn of African country, narrowly avoided death Wednesday when three suicide bombers tried to kill him.
Islamist militants of al-Shabaab, affiliated with al-Qaida, claimed responsibility for the attack on the Jazeera Hotel in Mogadishu, Somalia's capital, where Mohamud was appearing at a news conference with visiting Kenyan Foreign Minister Sam Ongeri.
Two of the bombers detonated their explosives. The third was killed by security forces.
Eight people were killed in the explosions. Mohamud and Ongeri weren't injured.
Mohamud, a former university professor, was elected by Parliament Monday in Somalia's first presidential election since the 1991 overthrow of dictator Mohammed Siad Barre, the start of Somalia's nightmare.
Mohamud defeated the incumbent Sheikh Sharif Ahmed, whose United Nations-backed Transitional Federal Government was widely branded as inept and corrupt.
Since it was installed by the Western powers in 2006 after a U.S.-backed Ethiopian invasion against Somalia's Islamist rulers, the TFG signally failed to crush al-Shabaab. Indeed, until Kenyan and Ethiopian forces thrust into Somalia from the south and west in 2011, aided by a heavily reinforced African Union peacekeeping force that had kept the TFG in office, al-Shabaab controlled most of the country and the capital.
But the Islamists have been driven out of Mogadishu and most of their strongholds since then and are hard-pressed in the last stronghold, the southern port of Kismayo.
Wednesday's attempt to kill Mohamud appeared to be a desperate bid to head off a major defeat in a conflict that has troubled the region for two decades.
Ongeri was a bonus. Kenya, another U.S. ally in the region, is a target for al-Shabaab because of its alliance with the TFG.
There have been several terrorist attacks in Kenya in recent months. These could escalate as Kenyan forces prepare for a major offensive against Kismayo in the next few weeks.
Oil has been found in the region, including Kenya and northern Somalia. This has spurred the TFG and its allies to crush al-Shabaab but the group has come back from defeat before and demonstrated a dogged resilience.
Kenya is increasingly caught up in the messy Somali conflict. The assassination of a popular Muslim cleric Aug. 27 and the deadly clashes between Muslims and Christians it triggered exposed deep sectarian and political divisions.
These indicate further waves of bloodshed that will strengthen the Islamist militants.
In Yemen, where al-Qaida in the Arabian Peninsula, linked to al-Shabaab, are battling the U.S.-backed government, the attempt to kill the defense minister, Maj. Gen. Mohammed Nasser Ahmed, in a car bombing Tuesday emphasized the fragile security situation there.
Ahmed wasn't hit but a dozen people were killed.
The attack came a day after AQAP's deputy leader, Said al-Shehri, a Saudi, was killed in a U.S. drone strike, the latest in a barrage of such strikes in recent months that have eliminated key AQAP leaders. The raids helped government forces push back AQAP from southern cities it captured and had Yemen's army reeling.
However, the U.S. airstrikes have also killed up to 830 civilians, strengthening support for AQAP.
A former head of the CIA's counte-rterrorism arm, Robert Grenier, recently warned that indiscriminate use of drones is "creating more enemies than we're removing from the battlefield."