A Jordanian police captain shot dead two Americans and one South African at a police training centre near the capital, Amman, before being killed in a shootout, Jordanian authorities have said.

State news agency, Petra, said on Monday that the three foreign instructors killed were on contract with Jordanian police. At least two Jordanians were also killed in the attack, Petra said.

The attacker was shot dead by Jordanian security forces inside the US-funded training centre, Jordanian government spokesman Mohammad Momani said.

US President Barack Obama said he was treating the attack at the King Abdullah Training Center very seriously, and a full investigation was under way.

“The fact that someone dressed in military uniform carried out an attack at a training facility in [Jordan] … we take this very seriously, and we’ll be working closely with the Jordanians to determine exactly what happened,” Obama told reporters at the White House.

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. It was “premature to speculate on motive at this point” with the investigation proceeding, it said.

Pentagon spokesman Major James Brindle told Al Jazeera that the Pentagon was trying to verify the information, adding that he could not yet confirm the identity of the two dead Americans.

Members of the tribe the suspect belonged to, have been left wondering what was behind the incident.

“This young man used to only pray and fast. He had good relations with his parents, relatives, and brothers. He was a very peaceful man. We think that something provoked him to carry out such an attack, Suleiman Saed, a local tribe spokesperson, said.

The police training centre in al-Mowager, 30km from Amman, mainly trains Iraqi and Palestinian forces.

The attack coincides with the 10th anniversary of suicide bombings in Amman hotels that cost 60 lives and wounded dozens more.