Along the way, he said, a colleague warned him by phone that it was never a good idea to be the first one on the scene of an attack. But Mr. Abdihakim, 28 and determined, said he had to get there, and he did — in time for the second explosion.
He was standing next to some other journalists and filming the scene when the blast knocked them all to the ground. Both his hands were badly injured.
“Do I have any regrets? No,” he said from his hospital bed, wearing mittens of gauze. “But maybe it’s time to do something else.”
There seemed to be hundreds of people at the hospital, and the crowd thickened by the minute as battered cars raced up with more casualties. Armed men shoved past us, waving guns menacingly at anyone in the way.
For more than 25 years since its old central government collapsed, Somalia, one of the world’s poorest nations, has lurched from one crisis to another: civil war, famine, piracy, Islamic militancy. But in the last few years, it seemed as though another war was being waged for Mogadishu’s soul — between residents trying to get on with life and taste a little normalcy and those bent on ruin.
Peacekeepers from the African Union have managed to stabilize the main cities in recent years, clan-based militias have calmed down a bit, some foreign investment has flowed in and life has improved. Many roads are newly paved. There are now working streetlights and dry cleaners and cash machines, small miracles in a country that had become a byword for anarchy.
Somalia is in the process of selecting a new president, who will be chosen by members of Parliament in the next few weeks. Government officials say the Shabab has been trying to derail that process, and attacked the Dayah Hotel on Wednesday because some newly elected representatives were staying there. A similar explanation appeared on a website associated with the group.
The first explosion, officials said, was from a large truck bomb at the hotel gates. Four gunmen stormed in afterward, and the final explosion, a bomb in a minivan, went off about 15 minutes later.
Three of the assailants were quickly shot, and the fourth killed himself with a suicide vest, officials said. From photos of their bodies, all appeared to be young, possibly even teenagers.
According to Somali authorities, no government officials were killed in the attack. The dead were hotel guards, guests and bystanders.
Hussein Mohamed contributed reporting from Mogadishu.