An underground electric fire with minor explosions caused a temporary evacuation of some nearby buildings, officials said.