BAGHDAD—Iraq's security forces killed 38 people in clashes with mostly Sunni demonstrators and antigovernment insurgents in the northern city of al-Hawijah, as a raid on a protest camp transformed months of sectarian tensions into an armed conflict.

The clashes, on top of recent attacks on Shiite civilians by Sunni-aligned militants, risk fueling an outbreak of violence that has echoes in sectarian conflicts across the region.

Antiriot...