A man sentenced to death in 2002 for blasphemy and who spent 17 years awaiting execution has had his conviction overturned by Pakistan's Supreme Court, his lawyer told AFP on Thursday.

Wajih-ul-Hassan, a Muslim, also spent a year in jail before his conviction. He is expected to be released in the coming days after the decision was handed down by Pakistan's highest court on Wednesday, said the lawyer, Nadeem Anthony.

"Everyone was crying with happiness," he told AFP, adding that it had been a "long journey".

Blasphemy is a hugely sensitive issue in Pakistan, where even unproven allegations of insulting Islam can lead to assassinations and lynchings.

About 40 people convicted of blasphemy are currently on death row in Pakistan, according to a 2018 estimate by the US Commission on International Religious Freedom.

"Pakistan's blasphemy laws are overly broad, vague and coercive. They have been used to target religious minorities, pursue personal vendettas and carry out vigilante violence," Amnesty International said in a statement Wednesday.

The rights organisation also demanded Pakistani authorities release another blasphemy accused, university professor Junaid Hafeez, who has spent more than five years in solitary confinement.

There have been "severe delays" in his trial, with eight judges succeeding each other in the case without deciding his fate, according to Amnesty.

In May 2014, three gunmen murdered Hafeez's lawyer.

The acquittal last October of Asia Bibi, a Christian who had spent more than eight years on death row for blasphemy, provoked violent protests across Pakistan.

Bibi now lives in Canada with her family.

Most blasphemy cases involve Muslims in Pakistan, experts say.