Taliban militants attacked a Shia group of high school students on their way to school in northwest Pakistan on Tuesday, killing four of them and wounding three, a government official said.