Lawmakers in California approved on Wednesday a controversial bill that lets physicians assist patients in committing suicide, which has continuously been opposed by disabled and religious groups.

The bill would permit doctors to prescribe medications to patients who are critically in poor health to put an end to their lives. The California State Assembly voted 43-34 after plenty of weeks of debates and hearings, according to Reuters.

The decision marks the second time that lawmakers tried to introduce the assisted suicide bill following the case of Brittany Maynard, 29, a woman who had brain cancer and moved from California to Oregon to end her life.

Maynard peacefully committed suicide by taking a prescribed medicine, which was a deadly dose of barbiturates, citing that she could no longer endure the suffering any longer, as HNGN previously reported.

Assisted suicide is already legal in four states: Oregon, Washington, Vermont and Montana. Similar laws will apply in California if the bill gets the approval of the State Senate.

The first three aforementioned states have stringent rules regarding the extent of which the doctors can help the patient end their life, while doctors in Montana gain protection when they prescribe medication that could help their patients die, according to the Daily Mail.