The shock offensive sent residents fleeing and added fresh uncertainty to a region reeling from multiple wars.