Dozens were killed and injured in an attack by an armed group in a northwestern city.