Robert F. Bukaty/ASSOCIATED PRESS A bill granting terminally ill patients the right to choose physician-assisted death has been signed into law in Maine.

Maine Gov. Janet Mills (D) on Wednesday signed a bill granting terminally ill patients the right to choose to end their lives.

Seven previous attempts to pass a bill legalizing physician-assisted death failed in the Maine Legislature. But on June 4, the Democratic-led state Senate voted 19 to 16 to pass the bill, a day after the House approved it by just one vote.

Under the new law, doctors in Maine will be authorized to prescribe terminally ill patients a fatal dose of medication. A “terminal disease” in this case is defined as an “incurable and irreversible disease that has been medically confirmed and will, within reasonable medical judgment, produce death within 6 months.”

The legislation states that obtaining or administering medication to induce death, under the bill’s other stipulations, does not constitute suicide under state law.

Patients will be required to receive a second opinion from a consulting physician after submitting one written and two oral requests for the medication. After the initial oral request, they will need to wait 15 days before signing a written request, then an additional 48 hours before their physician may write the prescription, according to The Associated Press.

Physicians will also be required to screen patients for depression and other conditions that could be impairing their judgment.

Seven other states and the District of Columbia have enacted similar legislation enabling terminally ill patients to choose whether they want a medically assisted death. New Jersey passed its Aid in Dying for the Terminally Ill Act in April. Montana effectively legalized medically assisted death through a court decision in 2009, though lawmakers in that state have recently introduced legislation to challenge that ruling.