A speeding car exploded in the Somali capital Mogadishu on Saturday after it was shot at by police near the president’s residence, a police officer said.