The highest court of Pakistan has ordered an inquiry into the case of a man who spent three years in jail for a murder that never happened
A Supreme Court official confirmed on Wednesday that Malik Taj Mohammed had been the victim of a "huge injustice".
He proved his innocence when it was discovered that his "murder victim" was serving a jail sentence for theft.
Lawyers say the case is exceptional, even though false charges in criminal cases are often made in Pakistan.
The chief justice ordered Mr Mohammed's immediate release and told a lower court to carry out an inquiry to identify those officials responsible for wrongly incarcerating him.
A court official told the BBC that the victim, Malkani Bibi, was believed to have been murdered during a property dispute between relatives a few years ago, and a case was registered against Malik Taj Mohammed.
The official told the BBC that the accused had been convicted by a lower court of murder, and had been languishing in jail for the past three years.
Mr Mohammed told the chief justice that his "opponents" had even gone so far as to perform a mock burial of Ms Bibi, the official said.
Mr Mohammed informed the court that the "murdered" woman had in fact been arrested in another case and is currently serving a sentence in a prison in the city of Gujrat.
The chief justice ordered to the police to present her before him, and she was located and brought before the court.
After verifying the facts, he ordered the release of Mr Mohammed with immediate effect, and said the inquiry should establish whether he was entitled to any compensation.
Pakistani freed after murder victim found alive