A Jordanian policeman has opened fire at a police training centre outside Amman, killing two Americans, a South African and a Jordanian, officials say.
The Jordanian embassy in Washington said the assailant wounded five others, including two Americans and three Jordanians, before being shot dead.
President Barack Obama said the US was taking the attack "very seriously".
The US-funded Jordan International Police Training Centre (JIPTC) hosts mainly Palestinian and Iraqi officers.
Civilian contractors from the US and elsewhere assist Jordanian police trainers at the facility in Muwaqqar, on the eastern outskirts of Amman.
Jordanian government spokesman Mohammed Momani told the Associated Press that an investigation had been launched into whether the motive for Monday's shooting attack at the JIPTC was personal or political.
Jordan International Police Training Centre (JIPTC)
Built in Muwaqqar, east of Amman, in 2003 with US funds
Run by Jordanian Public Security Directorate (JPSD) and contractors
Original purpose was to train Iraqi Police Service (IPS) officers after US-led invasion of Iraq in 2003. More than 50,000 attended eight-week courses
Also provided "gendarmerie-style" training for thousands of West Bank-based Palestinian Presidential Guard and National Security Forces (NSF) troops
Plans were announced earlier this year to train former Libyan rebels
The assailant was a senior trainer with the rank of captain, a Jordanian security source was quoted as saying by Reuters.
The US embassy in Amman confirmed that two US government employees were killed and two wounded in the incident.
"Our heartfelt condolences go out to the families of all of the victims. The investigation is ongoing and it is premature to speculate on motive at this point," a statement said. "We are working closely with the government of Jordan and local security services on a full and comprehensive investigation."
"We strongly condemn this incident and we deeply appreciate the co-operation and support received from our Jordanian partners."
BBC Middle East correspondent Kevin Connolly says the kingdom of Jordan steers a strongly pro-Western course in the turbulent waters of the Middle East.
It hosts joint military exercises with countries like the US and UK, and strongly supports the US-led coalition against Islamic State militants in Syria.
In the absence of any other obvious motive for the shooting it will be assumed that the killings were intended as an act of solidarity with militant groups in the Middle East, our correspondent adds.
The incident comes on the 10th anniversary of bombing attacks by al-Qaeda in Iraq on three hotels in Amman which killed more than 50 people.