SACRAMENTO, Calif. (CBS13/AP) — The California Assembly approved legislation Wednesday that would allow terminally ill patients to legally end their lives, sending the proposal to the state Senate that is expected to endorse it.

Lawmakers in the state Assembly voted 42-33 after a lengthy and emotional debate during which many lawmakers invoked their religious faith in arguing for and against the legislation. Assembly members were seen as the stumbling block to advancing the bill.

“I as a Christian do not pretend to know what God has in mind for all of us, why there is pain or suffering in this world. But I do know he is a merciful God. And we have the ability to allow others to have a choice,” said Assemblywoman Catharine Baker, R-Pleasanton, who supported the measure. “I believe it is cruel – nothing short of cruel – to deny them that choice in their final hours and final days.”

Members of the California Assembly have passionate debate over "Right to Die" legislation. Vote expected soon. pic.twitter.com/6S36GvzzUJ — Derek Shore (@DerekShore) September 9, 2015

It was the second effort by lawmakers this year to allow doctors to prescribe life-ending medication following the highly publicized case of 29-year-old Brittany Maynard, a California woman with brain cancer who moved to Oregon to legally take her life.

An earlier measure stalled amid religious opposition and hesitant Democrats. The renewed push comes after at least two dozen states have introduced aid-in-dying legislation this year, though none of the bills has passed.

Doctors are permitted to prescribe life-ending drugs in Oregon, Washington, Vermont and Montana.

The right-to-die movement has been galvanized by the high-profile case of Maynard, who argued in widely viewed online videos that she should have been able to access life-ending drugs in her home state.

It’s not clear where Gov. Jerry Brown, a lifelong Catholic, stands on the issue.

Religious groups and advocates for people with disabilities opposed a nearly identical California bill introduced earlier this year, saying it goes against the will of God and put terminally ill patients at risk for coerced death. The measure passed the state Senate but stalled in the Assembly.

Assemblywoman Susan Talamantes Eggman, D-Stockton, introduced the latest bill as part of a special legislative session on health care financing convened by the Democratic governor.

Brown has declined to take a position on right-to-die legislation, although his spokeswoman said earlier this year that he did not believe a special session on health care was the appropriate venue to consider it.

Advocates also have turned to the courts, and the right-to-die advocacy group Compassion and Choices has said it would attempt to qualify a 2016 ballot measure if proponents lose in the Legislature.