At least 10 people, including a Canadian woman, have been killed, and at least 34 injured in a shootout between gunmen and police, Jordanian security sources have said.
Two local civilians and seven police officers were also among those killed at the castle in Karak, in south Jordan, on Sunday.
Some of the 34 people taken to hospital are said to have serious injuries.
Security officials announced they had killed four of the gunmen in the process.
The operation to capture the remaining gunmen continues, but Jordanian security forces freed tourists who had been trapped inside the medieval castle, after storming the building.
Police said gunmen shot at officers patrolling the city before entering a Crusader-era castle perched on top of a hill.
Prime Minister Hani al Mulki told parliament "a number of security personnel" had been killed and that security forces were laying siege to the castle.
The identity of the assailants was not immediately clear, but a former government minister from Karak city, Sameeh Maaytah, said there were signs Islamist militants may have been behind the attack.
"This was a group that was plotting certain operations inside Jordan," Maaytah told pan-Arab news channel al-Hadath