The head of Ukraine's Interior Ministry said the gunman took hostages and spoke to negotiators for 40 minutes before he was shot dead.