PROVIDENCE — State lawmakers on Wednesday passed, and Gov. Gina Raimondo moments later signed into law, legislation to preserve "the status quo" on abortion in Rhode Island, no matter what the future holds for the historic Roe v. Wade ruling.

As defined in the new state law, the status quo means: abortions are allowed up until the point a fetus could live outside the womb. An abortion would only be allowed later "when necessary to preserve the health or life'' of the pregnant woman.

Inking her signature to what she called a "very important and consequential bill,'' Democrat Raimondo said: "Fundamentally, this bill is about health care. It's about protecting and providing access to health care for all the women of Rhode Island.

"It's a difficult issue and there are good and principled people on both sides of the issue,'' Raimondo said. "But in light of all the uncertainty in Washington, and frankly, around the country in many other states, there is great deal of anxiety that ... a woman's right to access reproductive health care is in danger. ... The bill I am about to sign codifies Roe v. Wade. It preserves the status quo ... that has existed in this state for [close to] 50 years."

The legislation won Senate approval on a 21-to-17 vote, after a failed attempt by an antiabortion advocacy group, Servants of Christ for Life, to win a restraining order blocking the passage and subsequent signing of the legislation by Raimondo. A Superior Court judge denied the request.

Soon after the senators voted, the House voted 45-to-29 in favor of the reworked legislation chiefly sponsored by Rep. Anastasia Williams, D-Providence, that it had approved in March.

As the debate swung over several months from the House to the Senate and back again, deeply held religious beliefs collided with the anger and fervor of women’s rights activists in the Trump era; the dominant church in Rhode Island waged — and lost — a holy war against “the sin″ of abortion; and a House speaker who promised to be “the firewall” against “ultra-left-wing groups” felt compelled to let colleagues vote, for the first time in a quarter-century, on an abortion-rights bill. Senate President Dominick Ruggerio did the same, then cast his own vote against it as Mattiello did.

The Senate debate was punctuated by emotional speeches from senators on both sides of the abortion divide, especially from those raised, as the pregnant Sen. Sandra Cano said she was, "Catholic and pro-life."

"My faith is very important to me. I believe that life is sacred. ... However, I also believe that Roe v. Wade is the law of the land and I can't impose my faith on others," said Cano, a Pawtucket Democrat, who ultimately voted for the legislation.

Sen. Frank Lombardo, D-Johnston, also brought religion into the debate, but in his case as his reason for voting against the bill: "I pray you do what's right not because you have given your word ... not because people are telling you it should be a woman's right to choose."

"Do it because ... we are all children of God and I tell you, we will all be accountable to God for the position of influence that he has given to all of us,'' he told his colleagues.

Countered Sen. Gayle Goldin, a champion of the Senate version of the legislation: "My advocacy for reproductive rights is grounded in my own experience as a woman, as an adoptive parent, and as a religious minority."

"Judaism recognizes that denying a woman full access to the complete spectrum of reproductive health care, including contraception and abortions, deprives women of their constitutional right to religious freedom. The Reproductive Privacy Act is not only about a constitutional right to privacy, it is also the right to practice my religion without interference from the government,'' she said.

A longstanding abortion-rights supporter, Sen. Susan Sosnowski, read an email from an unidentified writer that said: "We all know that women of means, and mostly whiteness, will always be able to terminate a pregnancy if they feel it is necessary for their health and safety.

"It is women in poverty, young and very young women, women of color, women who are aware they are unable to care for the children they already have — let alone another one — women who have been raped by family members or brutally raped by strangers [are] women who need your help. For them the ability to terminate a pregnancy with safety and dignity and compassion is often a life-saver. ... I know from that experience."

"I believe what we need to do today is to trust women,'' added Sen. Joshua Miller, D-Cranston.

In their turn, Republicans Jessica de la Cruz of North Smithfield and Elaine Morgan of Hopkinton, the Senate minority whip, also urged "compassion,'' but for the fetus, "torn limb by limb'' during an abortion, with de la Cruz describing abortion as "the great injustice of our time."

"History will look back at us and say: Where were you? ... You allowed for children to be ripped from limb to limb with no care, no concern for their literal feeling."

But their tag-team efforts to amend the bill to require a doctor to give the fetus an anesthetic, or to link passage of legislation to an actual decision by the U.S. Supreme Court, or mandate more frequent inspections of "abortion clinics," failed on vote after vote.

From the Senate, the bill moved back to the House for a brief replay of the March debate, with Rep. Carol Hagan McEntee saying: "It is our body, our choice," and Rep. James McLaughlin saying: "How about the baby, OK? The baby that is going to feel all this pain and suffering? Did you forget them? I didn't."

Another abortion-rights opponent, Rep. Arthur Corvese, D-North Providence, raised the specter of renewed efforts to revisit abortion law and make future changes. He did not elaborate.

Wednesday began with this tweet from Catholic Bishop Thomas J. Tobin: "Praying fervently today that God will enlighten the minds and hearts of R.I. State Senators to vote against the horrible, extreme pro-abortion legislation being considered today."

By then, however, the momentum had already swung the other way in the most Catholic state in the nation.

The Rhode Island Right to Life Committee blamed the swirl of State House politics for the bill's passage, writing on its website:

"These powers and principalities of the General Assembly have now completely revealed themselves as the architects and actors behind this extreme abortion expansion, all the while continuing the pretense that they are pro-life ... an historic and monstrous betrayal."