Police said they were treating the stabbing as a militant attack