Afghanistan’s chief executive escaped unharmed, but nearly 30 people were killed, officials say.