Jordanian security forces stand guard at a military court in Amman as defendants accused of involvement in a 2016 shooting attack claimed by the Islamic State group stand trial on November 13, 2018

A Jordanian court sentenced two brothers to death on Sunday in connection with a 2016 attack claimed by the Islamic State group, overturning a life sentence handed to the men last year.

The shooting attack in Karak, home to one of the region's largest Crusader castles, killed seven policemen and two Jordanian civilians as well as a female Canadian tourist, and wounded 34 other people.

The head of the kingdom's state security court, a military tribunal, ordered Khalid al-Majali and Hamza al-Majali to be "hanged to death".

Jordan's cassation court, the kingdom's highest judicial body, reversed a November ruling which sentenced the two to life behind bars.

"The actions of the defendants caused chaos, panic and horror among Jordanians and foreign tourists and threatened the country's security and stability," a judicial source told AFP.

The two brothers were initially charged, along with eight others, with "terrorist acts", illegal possession of arms and producing explosives.

Three were sentenced to 15 years in prison and five others to serve three years in jail.

Courts in Jordan, the target of several deadly attacks, regularly put on trial suspected jihadists.

A close ally of Washington, the desert kingdom is part of a US-led coalition fighting IS in neighbouring Syria and Iraq, and it allows coalition forces to use its bases.