Security forces are struggling to contain Islamist violence that has spread across the region.