A Toronto man in his 80s who is suffering from terminal cancer now has the legal right to have his doctor help him die on his own terms, an Ontario court has ruled.

A judge delivered his ruling Thursday morning inside a University Avenue courtroom. The man, who didn't want to be publicly identified, asked the court to allow him to have a doctor deliver an injection of drugs that would kill him.

The man was diagnosed with lymphoma in 2012 and has been confined to a bed with devastating pain.

The ruling is the first of its kind in Ontario.

In a statement read outside the courthouse by his lawyer, Andrew Faith, the man said he was thankful for the ruling.

“This decision allows me, with the support of caring doctors, to die with dignity,” the man said, adding it allows him to “be in control” about how his life ends.

“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,” he said.

The man added that it is his wish that the government “will see fit” to make permanent changes to the laws surrounding right-to-die legislation “so that no other family will have to do this ever again.”

In his application, the elderly man said he fully understood the consequences of his request. The man’s family, his doctors and a psychiatrist have each said they support his request for a doctor-assisted death.

The applicant's lawyers had also asked the court to bar an invasive autopsy procedure once he dies. Current Ontario law would require the man's body to undergo an autopsy. After a brief court recess Thursday morning, the judge came back and granted this additional request as well. The man will not face an autopsy or a coroner investigation.

Both the federal and provincial governments said before the ruling that they would not oppose the man’s desire to die.