Slideshow ( 7 images )

AMMAN (Reuters) - A court in Jordan on Tuesday sentenced nine militants to prison terms ranging from three years to life for a shooting rampage two years ago in an ancient castle in the southern city of Karak that killed 10 people, including a Canadian tourist.

The court said the group of nine were involved in helping Islamist militants in attacks on the area surrounding an ancient crusader castle. The gunfights also left four militants dead.

The state security court found them guilty of “abetting terrorist acts that led to the death of human beings” and committing “terrorist acts using automatic weapons”.

Militants from al Qaeda and other radical jihadist groups have long targeted the U.S.-allied kingdom and dozens of militants are currently serving long prison terms.

King Abdullah, an ally of the Western powers against Islamist militancy and a defender of Jordan’s peace treaty with Israel, has been among the most vocal leaders in the region in warning of threats posed by radical groups.

Jordan plays a prominent role in the U.S.-led coalition against Islamic State, providing military, logistical and intelligence support, according to Western diplomats and regional intelligence sources.

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