Judge Shabbir Ahmad Awan handed down the verdict in Bahawalpur, around 600 kilometres (372 miles) south of capital Islamabad, finding Taimoor Raza guilty, prosecutor Shafiq Qureshi told AFP.
Raza had a Facebook argument about Islam with someone who turned out to be a counter-terrorism department official, defence lawyer Rana Fida Hussain said. The official brought charges against Raza based on the comments made on the social networking site.
Hussain said his client was innocent and that he would appeal the conviction. Millions of Pakistanis have been receiving text messages from the government warning them against sharing "blasphemous" content online.