Explosions and gunfire erupted near the Kabul headquarters of the Afghan election commission on Saturday, officials said, one week ahead of voting and after a series of bloody attacks in the city.