An explosion followed by gunfire hit the center of the Afghan capital Kabul on Saturday, close to the communications ministry and one of the city’s main hotels, officials said.