The sentence is the harshest among cyber-crime related sentences handed down so far in the country. Pakistan has never executed anyone convicted of blasphemy.
Judge Shabir Ahmed of the Anti-Terrorism Court in Punjab province's Bahawalpur district announced the sentence for 30-year-old Taimoor Raza after holding him guilty of posting derogatory content on Facebook.
According to the Counter Terrorism Department of Punjab Police, Mr Raza, who hails from Okara, some 200 km from Lahore, was arrested last year at Bahawalpur following complaints by his co-workers that he had shared blasphemous content on Facebook.
Blasphemy is an extremely sensitive issue in Pakistan where 97 per cent of the population is Muslim.
Pakistan's tough blasphemy law has attracted criticism from rights groups, who say they are frequently misused to settle personal scores.
Pakistan last year passed a controversial cyber crime bill (Prevention of Electronic Crimes Act 2016) that proposed strict punishment for cyber crime offences.