21-year-old Khadija Khatoon, who has a severe facial deformity, was told in her childhood that there is no help that doctors could provide. Getty Images/Christopher Furlong

A South African man who was seeking the right to end his life died early Thursday before hearing a landmark court ruling later that day that would have allowed him to commit assisted suicide. Euthanasia is illegal in South Africa, but Judge Hans Fabricius ruled a doctor could euthanize Robin Stransham-Ford, who was terminally ill with prostate cancer, without legal or professional consequences.

“It was apparently a peaceful death,” his ex-wife, Angela Botha, told South Africa’s RDM News Wire Thursday. Stransham-Ford died surrounded by family in Botha's Cape Town home.

In his plea to the judge in Pretoria, Stransham-Ford said he wanted to die at home with his family. “I wish to end my life with dignity, surrounded by my loved ones, while I am able to breathe on my own, speak to my loved ones and see and hear them,” he said, according to Pretoria News.

Stransham-Ford, 65, became a well-known advocate in Cape Town. He argued it was a violation of his human rights to deny him the ability to end his own life by euthanasia or assisted suicide by a doctor.

“My prognosis is that I shall die within two or four weeks. I have been in constant, extreme pain since January and I am unable to get out of bed,” he said in an affidavit, according to a local newspaper, Pretoria News. “I am not scared of dying. I am scared of dying in this terrible way.”

Fabricius ruled Thursday that Stransham-Ford was mentally competent and freely, voluntarily wanted assisted suicide, and medical practitioners who help him would not be held accountable criminally or civilly. Fabricius added the court order applied exclusively to this case, but the groundbreaking ruling could set a precedent in South Africa, according to Johannesburg newspaper the Citizen.