Riverside County Superior Court Judge Daniel A. Ottolia said The End of Life Option Act, which took effect June 9, 2016, was unconstitutional because the Legislature passed it during a special session convened by Gov. Jerry Brown to address health care-related issues.

Groups including the Life Legal Defense Foundation and the American Academy of Medical Ethics filed a lawsuit to overturn the law on the day it took effect. In a separate motion, they argued that medical aid in dying was not related to the stated purpose of the special legislative session that passed the act, explained Alexandra Snyder, executive director of the Life Legal Defense Foundation.

Ottolia agreed, stating in his decision that the law did not fall within the scope of the special legislative session, Snyder said. He also gave the state attorney general five days to file an emergency writ, a type of appeal, to seek a stay and keep the law in place.

California Attorney General Xavier Becerra said in a statement, "We strongly disagree with this ruling and the State is seeking expedited review in the Court of Appeal."

Read More

If the emergency appeal is denied, the law will be immediately struck down.

Many believe that California's End of Life Option was a response, in part, to a viral video of Brittany Maynard, a Californian with terminal brain cancer. Wanting to end her life, the 29-year-old moved to Oregon in June 2014 to take advantage of that state's medical aid-in-dying law. Maynard's family advocated for the law in California and elsewhere.

A California Department of Public Health report says 191 adults received prescriptions from 173 physicians for medical aid in dying between the law's passage and December 31, 2016. Of those, 111 ingested the prescribed drugs and died; 87.4% were 60 or older, and 83.8% were receiving hospice and/or palliative care.

Compassion & Choices, a nonprofit advocacy group for end-of-life options that made the video featuring Maynard, estimated that 504 California adults had received life-ending drugs from their doctors between the law's passage and June 2017.

The judge's ruling "is not a surprise, as the End of Life Option Act entered review by the legislature through an abnormal path," said Dr. Stephanie Harman, a clinical associate professor in Stanford University's Department of Medicine and a faculty member in the Stanford Center for Biomedical Ethics.

"We have seen more patients than we initially expected participating in the End of Life Option Act," said Harman, who was not involved in the lawsuit but has written about Stanford Health Care's experiences with the law.

She added that Stanford patients have mostly responded positively to the law. Primarily, patients "want to discuss what matters most at the end of their lives and understand what their options are and what will align best with their wishes," she said.

Meanwhile, there's the other side of the equation: physician participation. "Doctors, by the generic polls, have been generally supportive; in practice, very few participate," she said.

Dr. David Stevens, executive director of the American Academy of Medical Ethics, a national organization that has advocated against medically assisted suicide since 1994, said the End of Life Option Act "isn't about giving patients the right to die. This is about giving doctors the right to assist in killing."

He believes that physician-assisted suicide is "dangerous for the health care profession. It destroys trust between the doctor and the patient."

Worse, for patients, "the so-called right to die very quickly becomes the duty to die," Stevens said.

Follow CNN Health on Facebook and Twitter

See the latest news and share your comments with CNN Health on Facebook and Twitter.

Only a handful of states have authorized medically assisted suicide: California, Colorado, Montana, Oregon, Vermont and Washington, in addition to the District of Columbia.

In California, opponents including Catholic leaders and medical groups defeated a 1992 initiative to legalize aid-in-dying and stalled other bills in the state Legislature. Opponents argue that these laws could lead to coercion and abuse of vulnerable patients.