One gunman was killed in the operation to free around 20 shoppers and employees after a 17-hour hostage ordeal.