SAN DIEGO — A California judge on Friday rejected a request by physicians to immediately suspend a new state law allowing terminally ill people to end their lives.

Riverside County Superior Court Judge Daniel A. Ottolia said the law will remain in effect for now. He also agreed to allow the physicians to pursue their lawsuit claiming the law lacks safeguards to protect against abuse.

The law took effect June 9 and allows terminally ill adults to obtain a prescription for life-ending drugs if a doctor has determined they have six months or less to live.

Advocates argued that terminally ill people could face prolonged, painful deaths if the law is suspended.

Elizabeth Wallner, a Sacramento resident with stage IV colon cancer who attended the hearing, said she cried with relief when the judge denied the motion to suspend the law.

“I want to have the ability to control the end of life and protect my child from watching me be tortured to death,” she said. “It just gave me an immeasurable sense of peace.”

California is one of five states in which terminally ill people can end their lives. Oregon was the first to provide the option in 1997.

The California law is being challenged by the Life Legal Defense Foundation, American Academy of Medical Ethics and several physicians.

Opponents of the law say hastening death is morally wrong, puts all kinds of patients at risk for coerced death by loved ones, and could become a way out for people who are uninsured or fearful of high medical bills.

Attorney Stephen Larson, who represents the plaintiffs, said his clients want the law declared unconstitutional. Determining when someone has six months or less to live is arbitrary and opens the door for abuse, and doctors are not held accountable after they prescribe the life-ending drugs, he said.

“There are plenty of cases of elderly people suffering and people just want them gone,” Larson said. “This makes it too easy.”

The state attorney general’s office countered that medical professionals can refuse to prescribe and dispense the drugs. The law also specifies that the terminally ill person must be able to self-administer the drugs.

Both sides are due back in court Dec. 5.