An official statement said the four assailants, who shot at police targets in the town before heading to the Crusader-era castle, carried automatic weapons. Large quantities of explosives, weapons and suicide belts were seized in a hideout, the statement said.
It made no mention of their identity or whether they belonged to any militant group, raising speculation they could have been tribal outlaws with a vengeance against the state rather than Islamic State fighters, who control parts of neighboring Syria and Iraq.
A Canadian woman, three other civilians and five police officers were among the nine killed during the exchange of gunfire between the assailants and security forces.