RIVERSIDE, Calif. (Reuters) - A California judge on Friday refused to suspend a new state law allowing physician-assisted suicide for terminally ill patients, citing the need to protect them from pain, but he allowed a legal challenge to proceed.

The mixed ruling portends a continued debate over the highly contested law in the first months of its implementation.

“The court won’t be deterred when there’s a matter of public interest this large,” Riverside County Superior Court Judge Daniel Ottolia said on Friday.

A group of doctors in Riverside, east of Los Angeles, filed a lawsuit to overturn the so-called California End of Life Option, which was passed by the state legislature last year and went into effect in June.

Attorneys for the doctors requested a preliminary injunction to suspend the law while the lawsuit proceeds. But Ottolia denied the request, saying it would harm terminally ill patients.

“The injunction would subject them to additional pain,” Ottolia said in court.

Ottolia also ruled on a request by the state and other supporters of the End of Life Option to dismiss the lawsuit instead. They argued the doctors lack proper legal standing to bring their case.

“Plaintiffs have patients that fall under the act so the case is not hypothetical,” Ottolia said, in denying the request to put aside the lawsuit.

California was the fifth U.S. state to legalize medical aid in dying for terminally ill patients, terminology that advocates prefer over the phrase “physician-assisted suicide.”

At least 30 individuals are known to have obtained a prescription under California’s law since it took effect on June 9, according to Compassion & Choices, a group backing the law.

The doctors named as plaintiffs were joined by the American Academy of Medical Ethics, also known as the Christian Medical and Dental Society.

The law in question allows terminally ill patients to obtain a prescription for medication to hasten their death so long as two physicians agree that the person has no more than six months to live and is mentally competent.

The statute also requires a patient seeking life-ending medical aid to present two separate requests to an attending physician and for two witnesses to attest to the patient’s wish to die.

The bill was strongly opposed by some religious groups, including the Roman Catholic Church, as well as advocates for the elderly and disabled. They argued unscrupulous caregivers or relatives could pressure vulnerable patients to take their own lives.

To win an injunction, the plaintiffs had to convince Ottolia they have a strong likelihood of prevailing on the merits of their challenge.

The lawsuit’s essential argument is the law violates some patients’ constitutional rights to due process and equal protection by arbitrarily labeling them terminally ill.

“It is nearly impossible for doctors to accurately predict how long a seriously ill person may live,” attorneys for the physicians said in court papers.

But Ottolia said on Friday that no one was being forced to participate in assisted suicide.