NEW YORK (Reuters) - New York’s highest court on Thursday ruled that doctor-assisted suicide is illegal in the state, rejecting a lawsuit claiming that mentally competent, terminally ill patients have a right to have their doctors prescribe lethal drugs.

In a unanimous, unsigned opinion, the seven judges of the New York Court of Appeals said the state had legitimate reasons for outlawing the practice, including to protect vulnerable patients from pressure to end their lives.

“We are very disappointed by the court’s decision,” said Edwin Schallert, a lawyer for the patients and doctors who brought the lawsuit. “It will prevent terminally ill New Yorkers from exercising an important option to achieve a peaceful death.”

Schallert said he would likely move for the court to reconsider its decision, which cannot be appealed to any higher court.

The office of New York Attorney General Eric Schneiderman, which defended the law in court, had no immediate comment.

The patients and doctors argued in their 2015 lawsuit against the state that a New York law making it a crime to help another person commit suicide does not apply to doctor-assisted suicide for mentally competent, terminally ill patients. Advocates of the practice prefer to call it “aid-in-dying.”

They also argued that a ban on doctor-assisted suicide would violate the state’s constitution by depriving patients of their fundamental right to self-determination.

Of the three patients involved in the lawsuit, two have since died, according to Thursday’s opinion. Both a trial-level court and a mid-level appeals court ruled in favor the state.

The Court of Appeals said Thursday that the state law against assisted suicide contained “no exceptions” for doctors.

It also said the state constitution did not include a fundamental right to doctor-assisted suicide, which it distinguished from patients’ right to hasten death by refusing treatment.

That right, the court said, rested on “a person’s right to resist unwanted bodily invasions,” and did not imply the right to be prescribed a drug that would actually cause death.

In a separate opinion, Judge Jenny Rivera concurred that there was no broad right to doctor-assisted suicide, but said there should be an exception for mentally competent, terminally ill patients facing “certain, imminent, excruciating death.”

Laws in five states - California, Colorado, Oregon, Vermont and Washington - allow doctor-assisted suicide, according to the National Conference of State Legislatures. A Montana court ruling protects doctors there from prosecution for assisted suicide.