Local police official Raheem Khan said Thursday that 17-year-old Aitzaz Hasan died Monday in a remote village in Hangu, a district in Khyber Pakhtunkhwa province.
A teacher at the school told investigators that he saw Hasan chasing the attacker and then saw the attacker detonate the bomb that killed the teen, Khan said.
Pakistani media reported that Hasan was late for school and that's why he was outside when the attacker approached the building.
The English-language Express Tribune newspaper reported that Hasan's father, Mujahid Ali, was living and working in the United Arab Emirates when the attack occurred. Many men in the impoverished region are forced to move abroad, especially to the Gulf, to provide for their families.
Ali told the newspaper that he had returned not to mourn his son but to celebrate his life.
"My son made his mother cry, but saved hundreds of mothers from crying for their children," he told the newspaper.
Local resident Miqdar Khan said people in the district were hailing the teen as a hero, and hundreds of people attended his funeral to pay their respects. He said the teenager was known for openly criticizing militants.
"Aitzaz Hasan used to tell all that one day he would capture some suicide bomber, and his class fellows used to laugh," he said. "But this boy proved what he said, and I am sad that he left us too early."
The area where Hasan lived is home to many members of the minority Shiite Muslim sect who have often been killed by militants who view them as heretics.
Suicide bombings and killings have become an everyday fact of life in many parts of Pakistan.
A study by the Islamabad-based Pak Institute for Peace Studies found that terrorist attacks in 2013 increased by nine percent over the previous year while the number of people killed in such incidents jumped by 19 percent. The number of suicide attacks climbed by 39 percent in the same period, the report found.
In the face of such unremitting violence the image of a teenager giving his life to save his classmates captured the imagination of many in Pakistan.
Hasan's death led to an outpouring of emotion on television and on social media, where the hashtag #onemillionaitzazs quickly became a favorite among Twitter users.
Pakistan's former ambassador to the United States, Sherry Rehman, tweeted that Hasan should be given a medal: "Another young one with heartstopping courage."
Chaudhry Mohammed Sarwar, the governor of the eastern Punjab province, told Pakistan's Dunya news channel that Hasan should be honored.
"He is the hero of the whole nation as he has saved many lives by giving his own life," Sarwar said.
Take ABC13 with you!
Download our free apps for iPhone, iPad, and Android devices