The California Senate approved a physician-assisted suicide bill that would allow some terminally ill patients to obtain medication to end their lives. Opponents of the bill say it is dangerous.

The bill was approved in a Senate vote of 23-13 and now moves to the state Assembly for approval. If passed there, it will head to Governor Jerry Brown for signature. There were two previous assisted death bills in 2005 and 2007, but they both failed in the legislature.

“Californians with terminal diseases should have the autonomy to approach death on their own terms, and I look forward to continuing this policy discussion in the Assembly,” California Senator Bill Monning, (D-Carmel), one of the bill’s sponsors, said in a statement.

The legislation, called the End of Life Option Act, would allow adults suffering from incurable or irreversible illnesses, which doctors claim will kill them within six months, to obtain medication that they could self-administer to end their own lives. The bill comes with safeguards against abuse, requiring two physicians to confirm a patient’s prognosis of six months or less to live. It also requires a patient’s mental capacity to be sufficient for them to make their own healthcare decisions.

READ MORE: Permission to die: California doctors no longer opposed assisted suicide

The bill also makes it a felony to coerce a patient into making an end-of-life request or to forge one.

Five other states have approved physician-assisted suicide – Montana, New Mexico, Oregon, Vermont and Washington State – but California’s act would make it legal in one of the most populous states in the US. The bill gained momentum following the much-publicized assisted death of Brittany Maynard, 29, who was terminally ill with an aggressive form of brain cancer and moved to Oregon last year to end her life.

Before her death, she videotaped an appeal to California lawmakers to make assisted death an option. The Los Angeles Times reported Governor Brown called Maynard in the weeks before her death to discuss possible legislation, according to his office.

“They had a conversation prior to her passing,” Evan Westrup, a spokesman for the governor told the LA Times.

The bill also got a boost last month when the California Medical Association abandoned its 30-year opposition to physician-assisted suicide. It was the first state medical association in America to do so.

CMA officials said they were motivated by the desire to preserve the doctor-patient relationship and made the decision after extensive consultations with lawmakers. The association’s spokeswoman, Molly Weedn, told Reuters the key concern was that doctors not be required to participate in assisted suicide or refer patients to a colleague who does.

“As physicians, we want to provide the best care possible for our patients,” CMA President Luther Cobb said in a statement. “However, despite the remarkable medical breakthroughs we’ve made and the world-class hospice or palliative care we can provide, it isn’t always enough.”

READ MORE: Stephen Hawking: 'I would consider assisted suicide'

Critics of the bill said they feared some patients would be steered toward assisted suicide if insurers deny or delay coverage for life-sustaining medical treatments.

“Unfortunately this vote sends a message to people like me that suicide is a preferred option,” Stephanie Packer, 32, who was diagnosed with a terminal illness, said in a statement issued by Californians Against Assisted Suicide, according to Reuters.

Just this week, the globally renowned physicist, Professor Stephen Hawking, 73, admitted he would consider assisted suicide if he felt he had nothing more to contribute to the world and was a burden on his family.

“To keep someone alive against their wishes is the ultimate indignity,” said Professor Hawking in a BBC interview.

Hawking was diagnosed with a rare terminal motor neuron illness at the age of 21 and given two to three years to live.

“I would consider assisted suicide only if I were in great pain or felt I had nothing more to contribute but was just a burden to those around me,” he said. “But I’m damned if I’m going to die before I have unraveled more of the universe.”

Professor Hawking’s remarks came days after the Scottish Parliament rejected a bill to legalize assisted suicide.