By Suleiman Al-Khalidi
A Jordanian officer shot dead two US government security contractors, a South African trainer and two Jordanians at a US-funded police training facility near Amman before being killed in a shootout.
US President Barack Obama said he was treating very seriously the attack at the King Abdullah Training Centre, in which three Jordanians and one Lebanese citizen were also wounded.
A senior Jordanian official said the gunman was a police captain, and authorities identified him as Anwar Abu Zeid.
There was no immediate word on the motive for the attack.
Jordan is a staunch US ally in the Washington-led campaign against Islamic State militants who hold large areas of neighbouring Syria and Iraq, a position Jordanian officials say leaves the kingdom vulnerable to jihadist attacks.
"This incident sadly does not come as a surprise, as the threat of Islamist terrorism has only increased in the region in the last few years in the aftermath of Syria and Iraq," said a senior Jordanian official who requested anonymity, citing political sensitivities.
The US Embassy in Amman said two American civilian security contractors and a South African contractor were shot to death, and one slain Jordanian was a translator.
A second Jordanian, who had been in critical condition, died later of his wounds, Jordan's government said.
There were differing early reports on the number killed, with three US sources saying eight people died in the attack. Jordanian government spokesman Mohammad Momani denied that and Jordan's official death toll stands at six.
The shooting spree took place on the 10th anniversary of al-Qaeda suicide bombings that targeted three Amman luxury hotels and killed 57 people, the deadliest militant attack in Jordanian history.
Momani, the government spokesman, said the attacker was shot dead by Jordanian security forces inside the training centre.
Relatives of the suspect gathered at his home in a village near the northern town of Jerash, expressing disbelief the 29-year-old father of two could have committed the attack.
A security source said the shooting spree took place in the canteen of the training facility. Leaked photos published online, purportedly of the shooting scene, showed blood splattered on the floor with smashed tables and glass.
The training facility was set up on the outskirts of the capital, Amman, after the 2003 US invasion of Iraq to help rebuild the shattered country's postwar security forces and to train Palestinian Authority police officers.
Jordan hosts several hundred US contractors who are part of a military program to bolster the kingdom's defences.