Pakistan's highest court has ruled that schizophrenia does not qualify as a "mental disorder" under the country's legal definition, paving the way for a mentally ill man's execution.
The United Nations warned it would be against international law to hang Imdad Ali, who was sentenced to death over the murder of a religious scholar in 2002.
In 2012, the 50-year-old was diagnosed with paranoid schizophrenia and psychosis that doctors said impaired Mr Ali's "rational thinking and decision-making capabilities", and was declared clinically insane in a medical report the following year.
But he lost his final appeal last year and has since had his execution stayed by a last-minute appeal lodged by his wife at the Supreme Court.
On Thursday, judges ruled that the execution can go ahead, after finding that Mr Ali's schizophrenia is not a permanent condition and varies according to the "level of stress".
Reprieve, a UK-based legal charity, said the court claimed that "it is, therefore, a recoverable disease, which, in all the cases, does not fall within the definition of 'mental disorder' as defined in the Mental Health Ordinance, 2001".
The decision Mr Ali could be executed as early as 26 October, despite a medical assessment in September concluding his illness appeared to be "treatment resistant".
Previously, the same court said a large proportion of prisoners in Pakistan suffer from mental illness and that authorities "cannot let everyone go".
Maya Foa, a director of Reprieve, said: "It is outrageous for Pakistan's Supreme Court to claim that schizophrenia is not a mental illness, and flies in the face of accepted medical knowledge, including Pakistan's own mental health laws.
"It is terrifying to think that a mentally ill man like Imdad Ali could now hang because judges are pretending that schizophrenia is not a serious condition.
"Pakistan's President needs to urgently intervene to stop this sickening attempt to hang Imdad."
The UN's human rights office has called on the government to halt Mr Ali's execution and to launch a re-trial "in compliance with international standards".
"It is a violation of death penalty safeguards to impose capital punishment on individuals with a psychosocial disability," said a panel of experts from the Office for the High Commissioner of Human Rights (OHCHR).
"The courts have disregarded medical reports asserting that the defendant has a psychosocial disability and have not conducted an independent evaluation of his mental health status.
"Implementing the death penalty under these conditions is unlawful and tantamount to an arbitrary execution, as well as a form of cruel, inhuman or degrading punishment."
The body said Mr Ali was referred for mental health treatment a year before the alleged murder but that the illness was not mentioned in the court ruling sentencing him to death.
In September, the first secretary of Pakistan's permanent mission to the UN said the government was examining the country's penal code to determine whether the death penalty could be "narrowed" amid criticism over Mr Ali's case.
More than 400 people have been executed since the government lifted a four-year moratorium on the death penalty in 2014, following the Taliban's massacre at a school in Peshawar.
Capital punishment was initially only restored for terror offences but later reinstated for kidnapping, murder, blasphemy and other capital crimes, leaving more than 8,000 prisoners on death row