Gov. Phil Murphy signed the Medical Aid in Dying bill Friday, making New Jersey the eighth state to allow terminally ill patients to request prescriptions from their doctors for medication to end their lives.

“By signing this bill today, we are providing terminally ill patients and their families with the humanity, dignity, and respect that they so richly deserve at the most difficult times any of us will face,” Murphy said, surrounded by lawmakers who sponsored the bill and its supporters.

The Medical Aid in Dying bill does not allow mercy killing, euthanasia, or assisted suicide. Patients must get a diagnosis from two New Jersey doctors saying they are terminally ill before they can get a lethal drug, often a barbiturate. The bill also says the patients can take the medication in the presence of a loved one or others, or opt to take it alone, but must be of sound mind and must administer it themselves.

Patients must have a prognosis, based upon reasonable medical certainty, of six months or less.

The bill took seven years to pass. “We’ve heard countless heartbreaking stories of terminally ill patients and their families yearning to make a personal choice that simply was not provided for under law,” said Assemblyman John Burzichelli, a Democrat from Gloucester County who sponsored the bill from the beginning.

The original Aid in Dying bill, similar to the approved version, passed in the Assembly in 2014 but didn’t get to a vote in the Senate. New attention was brought to the issue that year when Brittany Maynard, a 29-year-old California woman diagnosed with an aggressive terminal brain cancer, moved to Oregon to take advantage of that state’s “death with dignity” law.

Her husband, Dan Diaz, who is an advocate with Compassion and Choices, was present at thesigning Friday. “New Jersey becomes the fifth state in the five years since her death to pass this vitally important legislation.... I am very thankful to the New Jersey legislators who passed this law without excessive regulations that would prevent dying New Jerseyans from using this option," he said in a statement.

Critics, however, warn that disabled and vulnerable people may now face pressure from unscrupulous family members or caretakers to terminate their lives.

The Catholic Church calls the bill an affront to human life. The Diocese of Camden posted a warning on its website in February that the bill would go beyond the terminally ill and affect the “handicapped, elderly, depressed, and vulnerable." The Diocese of Trenton said a diagnosis of terminal illness is not always accurate and people may choose based on false information.

The Medical Society of New Jersey also opposed the bill, saying it requires a “physician to participate in the termination of human life and puts physicians at odds with their professional ethical requirements.” A statement on the medical society’s website said the group historically agrees with the American Medical Association’s Code of Medical Ethics but also supports patients’ right to make health-care choices.

Susan Boyce, a Rumson resident who has a terminal lung disease, says the bill is about individual choice. She has testified at hearings in the Statehouse. “I am eternally grateful to Gov. Murphy and Assemblyman Burzichelli for giving me this option to die peacefully, if I decide I need it,” she said. “Just having this option is a godsend that will enable me to live the rest of my life, however long it is, as fully as possible, knowing I won’t have to suffer needlessly at the end.”