The Charsadda District Court on Tuesday remanded a student who allegedly killed his college principal in Shabqadar yesterday to police custody for three days.
After a short hearing, Judicial Magistrate-I Attaullah Jan handed the student's custody to the police.
The grade 12 student, Faheem, had shot six bullets at his college's principal, Hafiz Sareer Ahmed, after being reprimanded for skipping classes to attend a dharna in Islamabad.
In a video acquired by DawnNews, the student, while being arrested, appeared to justify the murder saying he believed the college principal had committed blasphemy.
It was not immediately clear what prompted that charge.
"I have been taught... to kill... to not be afraid. Don't be afraid of disrespecting the one who [commits blasphemy]," the student can be heard saying in the video in Pashto.
"You can kill me," he tells the arresting officers.
Sources told DawnNews that the student had been angry that he was marked absent during the days he was attending the Faizabad sit-in.
Blasphemy is a highly sensitive issue in Pakistan, where even unproven allegations can stir mob violence and lynchings.
Last year, a mob in Abdul Wali Khan University Mardan beat up a student, Mashal Khan, to death after accusing him of blasphemy over social media.
The incident caused an outrage across the country, with calls for the blasphemy law to be amended. The investigation into Mashal's murder was concluded after a joint investigation team probing the case cleared the victim of all charges.
At least 65 people have been murdered by vigilantes over blasphemy allegations since 1990.