Jordanian policemen stand guard in the vicinity of Kerak Castle where armed gunmen carried out an attack, in the city of Karak, Jordan. REUTERS/Muhammad Hamed

AMMAN (Reuters) - Islamic State militants claimed responsibility on Tuesday for a shootout at a Crusader castle in the southern Jordanian city of Karak in which at least nine people including a Canadian tourist were killed.

An Islamic State statement said four IS fighters undertook the operation on Sunday that ended in their deaths. Jordanian officials have not said who they suspect in the attack though security sources said the perpetrators were Jordanian nationals.

Jordanian police said late on Sunday that they had killed four “terrorist outlaws” after flushing them out of the castle where they were holed up after an exchange of fire that lasted several hours. Security forces were able to release around 10 tourists unharmed. At least 30 people were taken to hospital.

Interior Minister Salamah Hamad said on Monday at least five suicide belts were found, together with an ammunition cache, automatic weapons and explosives in a hideout in a house in the desert town of Qatranah, 30 km (20 miles) northeast of Karak.

The gunmen had fled to Karak after an exchange of fire with the police, Hamad said. Based on the quantities of explosives and weapons, “I don’t think the target was just Karak castle, it’s more,” he added. He would not elaborate, saying disclosing details at this stage could imperil national security.

Jordan has been relatively unscathed by the uprisings, civil wars and Islamist militancy that have swept the Middle East since 2011, but maintains a high level of vigilance.

However, it is among the few Arab states that have taken part in a U.S.-led air campaign against Islamic State militants holding territory in Syria and Iraq. Many Jordanians oppose their country’s involvement, saying it has led to the killing of fellow Muslims and raised security threats inside Jordan.

Last November three U.S. military trainers were shot dead when their car was fired on by a Jordanian army member at the gate of a military base. Washington disputed the official Jordanian version that they were shot at for failing to stop, and said it did not rule out political motives.