Mashal Khan, 23, was stripped, beaten and shot by a gang made up mostly of students last April before being thrown from the second floor of his dormitory at Abdul Wali Khan University in the northwestern city of Mardan.
The brutality of the attack, which was recorded on mobile phone cameras and posted online, stunned the public and led to widespread condemnation including from prominent Islamic clerics. Protests erupted in several cities.
"One of the accused has been awarded a death sentence, five were given life imprisonment while 26 have been acquitted," Saad Abbasi, a defence lawyer, told AFP at the prison where the verdict was announced.
An additional 25 were given three-year sentences, he added, saying he planned to file an appeal against the decision.
The court sentenced Imran Sultan Mohammad to death over his role in shooting Khan during the lynching, a crime he confessed to earlier.
Ahead of the verdict, heavy security was enforced at the jail in the city of Haripur where the accused were detained, with the area cordoned off by police and elite commandos.
The proceedings were held in an anti-terrorism court inside the jail for security reasons.
Around 100 relatives of the accused students waited outside the prison walls as news of the verdict trickled out.
"A day will come that the judge will answer the God. The verdict he has announced is unjust," said Waheedullah, whose son was given a three-year sentence.
Around two thousand people gathered at the main entrance of Mardan city, Khan's hometown, showering the acquitted students with flowers, chanting slogans against the provincial government and demanding the release of those convicted.
Students who took part in the attack had been rounded up after being identified through CCTV footage from the university and video clips.
An official report released months later concluded Khan was falsely accused, saying the murder was instigated by members of a secular student group who felt threatened by Khan's growing prominence as a critic of rising fees and of alleged corruption at the university.
Blasphemy is an enormously sensitive charge in Pakistan, and a criminal offence that can carry the death penalty.
While the state has never executed anyone under blasphemy laws, mere allegations have prompted mob lynchings and lesser violence.
Since 1990 vigilantes have been accused of murdering 65 people tied to blasphemy, according to research compiled by the Center for Research and Security Studies.
(This story has not been edited by NDTV staff and is auto-generated from a syndicated feed.)
Get the latest election news, live updates and election schedule for Lok Sabha Elections 2019 on ndtv.com/elections. Like us on Facebook or follow us on Twitter and Instagram for updates from each of the 543 parliamentary seats for the 2019 Indian general elections.