The military launched the offensive one month ago in the Swat Valley and neighboring areas to oust Taliban militants who were extending their control over the northwestern region , near the border with Afghanistan .