Muslim guerrillas attacked a town and took hostages yesterday as they withdrew from fighting that killed at least 22 people , military officials said .