Jordanian security forces say they have killed four gunmen after flushing them out of a historic hilltop castle in the city of Karak.
The gunmen had fled to the castle after a shooting spree that left 10 people dead including a tourist from Canada and at least four police officers.
Police said suicide belts and weapons had been seized at a hideout used by the "terrorist outlaws".
However, it was not clear if the men belonged to any militant group.
Earlier, the gunmen had opened fire on two police patrols before fleeing to the castle and attacking a police station there, officials said. Several tourists were trapped in the castle but were freed as security forces moved in.
At least 27 people have been wounded, some seriously.
Jordanian officials said events began earlier in the day with a shoot-out between police and armed men at a house near Karak. The gunmen then fled by car into the city.
The security directorate said gunmen had also shot at a security patrol before they reached the castle. Once inside they opened fire on a police station.
It is not clear if all the fatalities took place at the castle.
Footage on social media purportedly from the scene show armed police moving into the sprawling castle complex and helping tourists when shots ring out and they are forced to retreat.
US tourist Avinash Cavale told the BBC he and his wife were arriving by car at the castle when gunfire broke out.
"We were about 20m (60ft) from the castle gate when we started hearing gun fire. There were a lot of different types of firing coming from different directions," he said.
"We were still in the vehicle and just about to get out, so we closed the doors and local folks were yelling at us to get out. The street was very narrow but we reversed down."
Jordan is a close ally of the US and a member of the US-led coalition fighting the so-called Islamic State (IS) group in Syria and Iraq.
US forces have trained a small group of Syrian rebels in Jordan as well as Iraqi and Palestinian security forces.
IS has previously threatened to "break down" Jordan's borders.
In June the group said it was behind a suicide truck-bomb attack that killed six security personnel on the border with Syria.