MOGADISHU, Somalia — Four car bombs exploded outside a hotel in the capital, Mogadishu, on Friday afternoon, killing at least 20 people and injuring 17, the police said. The Islamic extremist group the Shabab claimed responsibility.

After three devices exploded in front of the hotel, a fourth blast hit as medics tried to rescue the injured.

The bombs detonated near the perimeter wall of the Sahafi Hotel, which is across the street from the Somali Police Force’s Criminal Investigations Department, said Capt. Mohamed Hussein.

Some of the victims were burned beyond recognition when one car bomb exploded next to a minibus, he said.