AMMAN, Jordan — Seven policemen, two Jordanian civilians and one Canadian tourist were killed Sunday when gunmen staged a series of attacks on police patrols and a historic castle in the heart of the southern city of Karak. Four gunmen were also killed.

According to Jordanian police, at least 20 others were injured, and security sources confirmed that as many as 14 people, mainly foreign tourists, were held hostage by the gunmen. By evening, according to local media, Jordanian special forces had freed them after a five-hour standoff.

During the attacks, as many as 10 gunmen holed themselves up in the Karak Crusader castle, a major tourist attraction and one of the most complete Crusader castles in the world.

Mosques’ loudspeakers across the city called on residents to flee as security operations intensified. Eyewitnesses reported chaos as thousands fled businesses and homes to the surrounding countryside.

The injured include a second Canadian tourist and 20 Jordanians, police said.

The identity and number of the assailants remain unknown, and no group has yet claimed responsibility. A person close to Jordan’s security agencies said authorities believe the assailants were extremists with ties to al-Qaida or the Islamic State.

The U.S. Embassy in Amman issued a statement to citizens warning of an “active shooter” in Karak, 80 miles south of the capital, and urged citizens to avoid the area.

Sunday’s attack marked the fourth deadly targeting of Jordanian security and army personnel this year.

Only subscribers are eligible to post comments. Please subscribe or to participate in the conversation. Here’s why.

Use the form below to reset your password. When you've submitted your account email, we will send an email with a reset code.