SACRAMENTO, Calif. — California will be the first state to require abortion medication on college campuses under a law signed Friday by Democratic Gov. Gavin Newsom.

The law takes effect in 2023 and only applies to the 34 campuses in the University of California and California State University systems. But the law will only be implemented if a state commission can raise more than $10 million in private donations to pay for it.

Former California Gov. Jerry Brown vetoed a similar bill last year, arguing it was not necessary because abortion services were readily available off campus.

But Newsom, who took office in January, said the law is needed “as other states and the federal government go backward, restricting reproductive freedom.”

Several Republican-led states, including Georgia, Kentucky and Mississippi, have passed laws banning abortions once a fetal heartbeat is detected. Abortion-rights groups are challenging those laws in court.

“Abortion is a protected right, and it is important that everyone — including college students — have access to that right, if they so choose,” said Democratic Sen. Connie Leyva, the bill’s author.

Religious and anti-abortion groups opposed the bill, with Live Action President Lila Rose saying the law “turns universities into abortion centers.” And Maria Jose Fernandez, legislative advocate for the California Catholic Conference, said the law is “trying to limit the alternatives for women.”

“We’re giving them the option to terminate a life, but what about those who want to continue on with that pregnancy? Where is the help for those women?” Fernandez said.

The medication is an option for women who are less than 10 weeks pregnant. The process requires taking two pills. The first pill, taken at the clinics, blocks the hormone progesterone. The second, taken a few days later at home, has an effect similar to a miscarriage.

More than 400,000 women attend public universities in the state.

Officials at the University of California and California State University did not take a position on the bill as it worked its way through the state Legislature. California State University spokesman Michael Uhlenkamp said the university will comply with the law by 2023.

University of California spokeswoman Sarah McBride said the university “believes students should have access to affordable and convenient reproductive health care of their choosing.”

“The university is currently evaluating next steps and will implement the law accordingly,” she said.

Also Friday, Newsom signed a law clarifying that Planned Parenthood can prescribe birth control via teleconference without a video chat, as they can in other states.

Jodi Hicks, president and CEO of Planned Parenthood Affiliates of California, said the bill signings show “that California understands reproductive health care is health care. And health care is a human right.”