For nearly half a century, the federal courts could be counted on to protect women and their constitutional right to a safe and legal abortion. The U.S. Supreme Court affirmed in four major rulings — starting with Roe v. Wade — that women have a right to an abortion up to the point of viability of the fetus at about 24 weeks and could not be hindered by onerous requirements.

As states came up with a profusion of unconstitutional restrictions, including bans on abortions early in pregnancy, federal district and appellate courts batted them down one after the other. The courts have stopped a dozen state laws that would have banned early abortions.

The relentless onslaught finally paid off for states determined to roll back abortion rights. This month, the Supreme Court, in a 5-4 decision, refused to block, even temporarily, an abominable Texas law that effectively disallows abortions when cardiac activity can be detected — starting at about six weeks of pregnancy, when most women don't even know they are pregnant — and empowers citizens to enforce it by suing anyone who helps a woman get an abortion.

Casting its inaction as concern about the technicalities of the case, a passive-aggressive Supreme Court majority essentially abandoned 7 million Texas women of reproductive age to a law designed to unconstitutionally thwart their ability to make their own informed choices about their bodies. Enough of this.

It's time for Congress to pass a law codifying the tenets of Roe v. Wade and stop state lawmakers' attempts to chip away the right to an abortion. The identical House and Senate bills — both called the Women's Health Protection Act — would not just guarantee the right to an abortion but would outlaw the absurd and unnecessary restrictions that states have put on women and abortion providers. The House bill has 205 cosponsors. The Senate bill has 48. Both bills had spent years languishing in their chambers. But House Speaker Nancy Pelosi says the House version will be ready for a vote when Congress returns from recess.

Other efforts underway to combat the Texas law are important as well. President Joe Biden has decried it, and U.S. Attorney General Merrick Garland has said the Justice Department will protect women's access to abortion clinics under the Freedom of Access to Clinic Entrances Act while the department "urgently explores all options to challenge" the Texas law.

Meanwhile, abortion rights advocates continue their battle against the law in the Fifth U.S. Circuit Court of Appeals — which could take months. At the same time, legislators and governors in other states hostile to abortion rights, such as South Dakota, Florida, Arkansas and South Carolina, have signaled their intention to consider laws similar to the Texas measure.

Clearly there will be more attacks on Roe v. Wade, and one of them is likely to stick. Also ominously looming on the horizon is Mississippi's request to let a 15-week abortion ban stand, which the Supreme Court has agreed to hear. There is almost no way that the court can uphold that ban without gutting Roe.

Congress can no longer sit on the sidelines. "The venue for protection has shifted significantly to the Congress and the administration," said Nancy Northup, chief executive of the Center for Reproductive Rights, which has pushed for the Women's Health Protection Act and is one of the groups that filed a lawsuit against the Texas law.

At the moment, the bill stands a better chance of passing in the House than it does in the Senate. But there's good reason to put it to a vote in Congress: We get to see which of the people's representatives are willing to support a woman's constitutional right to seek an abortion — and, perhaps more importantly, which do not.

Polls have consistently indicated that almost 60% of American adults believe abortion should be legal in all or most cases. It's time for members of Congress to stand up for women's rights and stop the harassment, the legal wrangling, the chipping away at the Roe v. Wade decision — all of which has kept women in numerous states from exercising control over their own bodies.

FROM AN EDITORIAL IN THE LOS ANGELES TIMES