California lawmakers approved a bill on Friday that would allow terminally ill patients to legally end their lives.

However, the next step is the most challenging one. Gov. Jerry Brown has not said whether he would end up signing the bill. Senators approved the bill on a 23-14 vote after an emotional debate on the final day of the legislative session.

"Eliminate the needless pain and the long suffering of those who are dying," urged Democratic Sen. Lois Wolk, one of the bill's co-authors.

Opponents of the measure say there are too many unanswered questions surrounding the bill. They fear it could cause premature suicides, according to the Los Angeles Times.

"I'm not going to push the old or the weak out of this world, and I think that could be the unintended consequence of this legislation," said Republican Sen. Ted Gaines.

The bill to allow doctors to prescribe life-ending medication passed on its second attempt after the heavily publicized case of Brittany Maynard. The 29-year-old California woman with brain cancer moved to Oregon to legally take her life.

Maynard’s family tearfully watched the debate from the Senate floor, while supporters aligned the Senate balcony.

A previous version of the bill passed the Senate but failed to get through the Assembly until lawmakers there took it up in a special legislative session. The move drew criticism from Brown.

Brown has not taken a stance on the bill. But Wolk told the Times Brown, a former Catholic seminarian, would be a challenge for him.

The revised measure includes requirements that the patient by physically capable of taking the medication themselves, that two doctors approve it, that the patient submit several requests, and that there be two witnesses.

Doctors in Oregon, Washington, Vermont and Montana already can prescribe life-ending drugs.

The Associated Press contributed to this report.