A Christian man in Pakistan was sentenced to death for blasphemy after he sent a WhatsApp message to a friend that insulted Islam, his lawyer said on Friday.

Nadeem James Masih was charged in July after his friend Yasir Bashir told the police that he sent him a poem on the messaging service that was insulting to Islam.

Following the incident, Mr. Masih fled from his home in Sara-e-Alamgir town in Punjab province to escape an angry mob that had gathered there, but later surrendered to the police.

His trial continued for more than a year at the Gujrat Jail, about 200 km from the provincial capital Lahore.

Besides the death sentence, Mr. Masih has been fined Rs 300,000, a court official told PTI.

Mr. Masih’s lawyer Anjum Wakeel said his client was “innocent”. “My client will appeal in the Lahore High Court as he has been framed for having an affair with a Muslim girl.”

Mr. Wakeel said the case against Mr. Masih was heard inside the prison due to security reasons.

A police official said the family of Mr. Masih had been taken into protective custody and moved to an undisclosed but safer location.

Pakistan, a Muslim-majority state, has a population of nearly two million Christians.

The minority community has previously been targeted by hardline religious groups and militants for blasphemy in Pakistan. In 2015, a Christian couple was burned in a brick kiln for desecrating the Quran.

Two years before that, a mob had burnt down nearly 125 homes of Christians in Lahore for alleged blasphemy by a Christian man.

The controversial blasphemy laws were introduced by former military ruler Zia-ul Haq in the 1980s and anyone charged under them becomes an easy target for extremists.

Civil rights groups argue that some Muslims use the laws to settle personal disputes with the minorities.

Former Punjab governor and liberal politician Salman Taseer was gunned down by his bodyguard, Mumtaz Qadri, in January 2011 in Islamabad when he spoke about the need to review the blasphemy laws.

Qadri was hanged to death last year.