The attacker, who took hostages inside a supermarket, was killed after a shoot-out with police, officials say.