The House on Friday passed legislation that would create a statutory right for health-care professionals to provide abortions, amid an intensifying legal battle over a Texas law that is the most restrictive in the nation. H.R. 3755, the Women’s Health Protection Act, was approved by the House 218 to 211 but faces tough odds in the evenly divided Senate.

The measure states that health-care providers have a statutory right to provide, and patients have a right to receive, abortion services without any number of limitations that states and opponents of the procedure have sought to impose. The measure would essentially codify Roe v. Wade, the 1973 Supreme Court decision guaranteeing the right to abortion before viability, usually around 22 to 24 weeks.

The new Texas law, which took effect Sept. 1 after the Supreme Court refused to immediately block its enforcement, bans abortions as early as six weeks into pregnancy and makes no exceptions for rape, sexual abuse or incest. The law allows private citizens to file lawsuits against anyone who helps a woman in Texas terminate her pregnancy. It was deliberately designed to avoid judicial scrutiny by barring state officials, who would typically be the target of lawsuits, from enforcing the ban.

Abortion rights proponents fear the most serious threats to the landmark ruling in nearly half a century, with Mississippi asking the Supreme Court to overturn Roe to allow the state’s restrictions on abortion access. The Mississippi law would ban most abortions after 15 weeks of pregnancy. Democrats see a political issue that has the potential to galvanize female voters ahead of the 2022 midterm elections.

The tone of Friday’s House debate on the measure was at turns somber and emotional. Some Democrats such as Rep. Jackie Speier (Calif.) argued that Republicans were “preaching birth, but not life.” Republicans countered that Democrats were “hiding behind women’s rights” and the new Texas law. “This bill has nothing to do with women’s health,” said Rep. Lisa C. McClain (Mich.) of the House legislation.

Several lawmakers shared personal stories, while others used props as they made impassioned arguments for or against the measure. Rep. Beth Van Duyne (R-Tex.) held a doll of a baby in the fetal position. Rep. Sylvia Garcia (D-Tex.) waved a wire coat hanger in the air and declared that “we will not go back” to the days of back-alley abortions. Speier spoke about her own second-term abortion, which she first revealed on the House floor a decade ago. Rep. David Schweikert (R-Ariz.) spoke about being adopted, reuniting with his birth mother and later adopting a daughter himself.

House Speaker Nancy Pelosi (D-Calif.) defended the House legislation, arguing that supporters of Roe have long sought to codify the decision but haven’t been able to in recent years because they lacked unified Democratic control of Congress and the White House.

She described herself as a Catholic mother of five and said the decision on bearing children was one that she made with her husband. “We should not, in this body or in that court, be making decisions for the women in America,” Pelosi said during the House debate.

Rep. Henry Cuellar (Tex.), who opposes abortion rights, was the sole Democrat to vote against the measure. All Republicans present voted “no.” In a sign of the legislation’s importance to Democrats, Pelosi cast a vote in favor. The speaker typically does not vote.

Public polling shows a majority of Americans support the right to abortion in most instances. A new Monmouth University poll this week found that 62 percent of Americans say abortion should be either always legal or legal with some limitations. That finding had changed little from a survey the university conducted two years ago.

Republicans have sought to cast the House measure as extreme and out of step with public opinion, with House Minority Leader Kevin McCarthy (R-Calif.) on Thursday denouncing it as a “radical bill” that goes beyond Roe.

In cases where a fetus has reached viability, the legislation allows for abortion only “when, in the good-faith medical judgment of the treating health care provider, continuation of the pregnancy would pose a risk to the pregnant patient’s life or health.” McCarthy falsely interpreted that part of the measure as allowing “abortion on demand, up until birth.” He said, “It shows how far left Democrats have become.”

Rep. Marjorie Taylor Greene (R-Ga.), a freshman who has aggressively confronted Democratic lawmakers in the past, got into a shouting match with Rep. Debbie Dingell (D-Mich.) and other Democrats on the steps of the U.S. Capitol after Friday’s vote.

“You should all be ashamed,” Greene told the Democrats, who had assembled for a news conference. As Greene walked away, Dingell chided her to act with civility. “You should practice the basic thing you’re taught in church: Respect your neighbor,” Dingell, standing a few yards away, yelled at Greene. “Taught in church?” Greene shouted back. “Are you kidding me? Try being a Christian and supporting life.”

As Dingell moved to walk down the steps, Greene then added, “Watch your step, lady, you’re going to fall down. Control yourself.” The House voted earlier this year to strip Greene of her committee assignments over her history of various extremist remarks.

In the Senate, the measure has the support of 48 senators who caucus with Democrats. Two key Democrats — Sens. Robert P. Casey Jr. (Pa.) and Joe Manchin III (W.Va.) — have not yet signaled how they would vote. Sen. Susan Collins (R-Maine), one of only two Senate Republicans who support abortion rights, told the Los Angeles Times this week that while she does support codifying Roe, she does not support the House measure because it would weaken conscience protections for health-care providers who do not want to perform abortions. “This ‘carve out’ would be unprecedented, and I do not believe it is necessary to codify Roe,” Collins said.

After declining for weeks to say whether President Biden would support the House measure, the White House said Monday it “strongly supports” the legislation, declaring, “We will not allow this country to go backwards on women’s equality.” It added, “The constitutional rights of women are essential to the health, safety, and progress of our nation,” in a statement of administration policy. “Our daughters and granddaughters deserve the same rights that their mothers and grandmothers fought for and won — and that a clear majority of the American people support.”

Friday’s House vote took place amid a tumultuous few weeks in the abortion rights battle, the effects of which are already being felt after the Texas law went into effect earlier this month. A group of abortion providers and advocates asked the Supreme Court on Thursday to once again take up the Texas law and to find that federal courts have a role in reviewing a state measure that effectively blocks a constitutional right.

The Biden administration has also sued the state of Texas to try to block the abortion law. A federal district judge in Austin last week gave Texas until Sept. 29 to reply to the Justice Department’s challenge and has set a hearing date for Oct. 1. The Justice Department says the Texas law deprives women in the state of the right to an abortion and imposes an “undue burden” and that the Constitution generally takes precedence.

A dozen other states have passed legislation banning abortions after about six weeks into pregnancy. But federal judges have stopped those measures from taking effect, finding the laws inconsistent with Roe. The Supreme Court has also scheduled arguments for Dec. 1 in the separate Mississippi case that tests Roe.

Alan Braid, a San Antonio physician, stepped forward last week to say that he had performed an abortion for a woman who was in the early stages of a pregnancy but beyond the state’s new limit. Braid is now being sued by three private citizens, in what may become a key test of the Texas ban’s constitutionality.

Marianna Sotomayor and Robert Barnes contributed to this report.