The siege ended with all militants killed, and all hostages freed, the defence minister said.