In a first for Ontario, a judge has granted an exemption that will allow a terminally ill Toronto man to end his life with the assistance of a doctor.

The 81-year-old man — who is only identified by his initials, A.B. — has said in a court affidavit that he is in the advanced stages of aggressive lymphoma. He was diagnosed in 2012.

Ontario Superior Court Justice Paul Perell granted A.B.'s exemption on Thursday after a 30-minute hearing. His family has said A.B. wants to die this weekend or sooner.

Neither the federal nor provincial government opposed the man's request.

A.B.'s lawyer, Andrew Faith, read a statement on behalf of his client following the judge's decision. A.B., a married grandfather, thanked the court for rendering a decision that will allow him to die with dignity.

"[The decision] relieves me from the mental and physical pain, should I so choose. But what is really important is that it allows me to be in control of when and how my journey will end. This is a right of human dignity and I am thankful that I no longer have to live under a cloud of stigma and shame that I feel as I slowly and painfully lose control.

A.B. also said he's had a good life and that his only regret was having to wage a court battle in his final months.

"My hope is that our government will see fit to make permanent changes in the law so that no other family will have to do this ever again. I believe firmly in the right to die with dignity and that it is a right that should be available to all Canadians to exercise according to their circumstances and beliefs."

1st for Ontario

Last year, the Supreme Court of Canada struck down laws that bar doctors from helping someone die, but put the ruling on hold for a year.

In February, the court granted the government a four-month extension, but said the terminally ill could ask the courts for an exemption to the ban during that period.

Perell said A.B.'s condition and circumstances met the criteria for such an exemption. He is:

Mentally competent.

In extreme pain.

Freely making the assisted-death request without coercion or manipulation.

Perell also became emotional, pausing several times as he read for the court information that details A.B.'s suffering.

A.B. said he is bedridden and "suffering intolerable pain and distress that cannot be eliminated" despite receiving pain medication and other narcotics.

His wish to end his life was supported in affidavits from his wife and his daughter.

"It is crippling emotionally to see someone you love in so much pain, so much distress," A.B.'s daughter said in her affidavit.

The court heard there are two options for a doctor-assisted death: an oral dose of a lethal medication or a lethal dose of a general anesthetic administered intravenously. The medication taken orally is not available in Ontario.

The lawyer for A.B.'s doctors said a hospital has agreed to provide A.B.'s hematologist with the lethal dosage of the anesthetic, which A.B.'s doctor is willing to administer.

When addressing the court, Faith said his client's condition was worsening and stressed the urgency of his request to die.

Names of doctors involved will stay confidential

Earlier this month, a judge ruled against a media request to identify the doctors involved in the court case.

Justice Thomas McEwen heard arguments from lawyers representing A.B., his doctors and media outlets over an application to keep the identities of the patient, his family and his health care providers private.

CBC, CTV, the Globe and Mail and Postmedia did not contest the patient's own wish for anonymity, as well as anonymity for his family. However, the media outlets did ask the court for permission to identify the health-care professionals involved.

McEwen ruled that "the confidentiality order is necessary in order to ensure that the applicant, his family, physicians and other health-care professionals are not deterred from participating in a charter application for fear of unwanted publicity and media attention."