A judge overturned California’s two-year-old aid-in-dying law on Tuesday, giving the state attorney general just five days to file an appeal.

California’s law allows terminally ill patients to request lethal dosages of medication from their physicians. The state was the fifth in the nation to legalize the practice, and the second to do so by legislative act.

But Riverside County Superior Court Judge Daniel A. Ottolia ruled the law invalid Tuesday, agreeing with plaintiffs who claimed the California Legislature should not have passed it during a 2015 special session on healthcare issues.

“We’re very happy with the decision today,” Alexandra Snyder, head of the Life Legal Defense Foundation, one of the groups that filed the lawsuit, told the Los Angeles Times.

California Atty. Gen. Xavier Becerra told the newspaper that state officials “strongly disagree” and will seek an expedited appeal.

California’s law allows patients with six months or less to live to request lethal medications. In its first six months, more than 100 people used it to die, state data revealed, and 59% of those had cancer.

Hawaii was the seventh and most recent state to pass a similar act, with the governor’s signature making it legal in April. According to the PEW Charitable Trusts, at least 25 other states are considering aid-in-dying bills this year.

The Times reported that almost 1 in 5 Americans lives are covered by physician-assisted suicide laws.

John C. Kappos, an attorney representing aid-in-dying advocate Compassion and Choices, said he believes the law should stand because aid in dying is a healthcare issue.

“Ultimately, we are confident an appeals court will rule the Legislature duly passed the End of Life Option Act and reinstate this perfectly valid law, which the strong majority of Californians support,” he said in a statement provided to The Times.