Military says dozens of soldiers killed in attacks in northwest and it was regrouping to launch a ‘counterattack’.