Abortion rights advocates shout during a 2013 rally in Richmond, Va., marking the 40th anniversary of the landmark Supreme Court ruling of Roe v. Wade. Republican lawmakers are laying the ground work to restrict the procedure in Virginia. (Bob Brown/Richmond Times-Dispatch via AP)

This session, Virginia House Republicans failed to pass a ban on abortions after 20 weeks of pregnancy, a top priority. But they are surprisingly upbeat, encouraged by signs in Virginia and across the country that their long-term strategy for restricting access to the procedure is picking up steam.

About a quarter of the legislature signed on to this year’s bill, including 10 from the Senate — historically the more moderate chamber. National public opinion appears to favor a 20-week ban. And Republicans are looking at 2018, when they hope to trade Gov. Terry McAuliffe (D) — a self-professed “brick wall” against limits on abortion — for an antiabortion Republican.

But they still have an uphill climb in Virginia, where Republicans running on social issues have consistently lost statewide races. The most recent example was Ken Cuccinelli II, an ardent abortion foe who lost the governor’s race to McAuliffe in 2013.

That hasn’t stopped Del. David A. LaRock (R-Loudoun) from trying to persuade the General Assembly to ban certain late-term abortions for the second year in a row.

“I really believe when people on either side of the aisle realize what this bill is about, we’ll come together and just say this can’t be done in a society that has regard for human life,” said LaRock, who teared up during an interview as he spoke of his 15 children and grandchildren. “So that’s why I’m passionate about it.”

He ultimately agreed to put the bill on hold for a year, but the effort proves that Republicans’ commitment to the issue has not waned since their failed 2012 attempt to require vaginal ultrasounds made Virginia a national punch line.

“This is straight from their playbook,” Del. Charniele L. Herring (D-Alexandria) said of the 20-week ban. “This is something they have tried in the past. Unfortunately, this is something they are serious about.”

Virginia is already among the 15 states with the most-restrictive laws governing abortion, according to the Guttmacher Institute, a reproductive-health research organization. The state prohibits abortions at the third trimester with exceptions, mandates an ultrasound, restricts abortion coverage in health plans through the federal Affordable Care Act exchange, limits Medicaid coverage of abortion and requires parental consent for minors, according to Guttmacher.

Abortion opponents want the 20-week ban because they say that’s the point when a fetus can feel pain — a claim that is a matter of dispute.

Antiabortion activists also see the 20-week abortion ban as a vehicle to challenge Roe v. Wade, the 1973 Supreme Court ruling which stated that the government cannot interfere with a woman’s right to an abortion before the fetus is viable outside the womb, between 20 and 24 weeks. The 20-week ban would move the cutoff several weeks earlier.

Nebraska passed the first 20-week ban in 2010, and 11 other states have enacted similar laws. The Virginia effort began with Del. Richard L. Anderson (R-Prince William) in 2012 and resurfaced in 2015 when LaRock filed a bill identical to one passed that year by the GOP-controlled U.S. House. The U.S. Senate blocked action on the bill.

Public opinion shows support for a 20-week ban. A national Quinnipiac Poll in November 2014 found that 60 percent of respondents support a 20-week abortion ban, including 76 percent of Republicans, 46 percent of Democrats and 56 percent of independents.

In Virginia, LaRock’s proposal got help from two top House lawyers not known for vocal views on abortion. Del. David B. Albo (R-Fairfax) and Gregory D. Habeeb (R-Salem), who serve on the committee that considered the bill, crafted new language intended to help it pass legal muster without unintended consequences.

But after two hearings and hours of testimony, antiabortion advocates couldn’t get past two sticking points: They objected to language that they say would have allowed abortions in cases of fetal abnormalities, and, although they allowed an exception for when the life of the mother is in peril, they drew the line at mental health.

“I can jokingly say, who wouldn’t say that a pregnancy makes them a little bit crazy at times?” LaRock said. “It certainly did my wife.”

Although LaRock agreed to let it go this year, activists had reason to celebrate. Not only did two dozen delegates agree to be sponsors, 10 senators took the rare step of signing on to House legislation before it crossed over to their chamber.

That troubles Tarina Keene, executive director of NARAL Pro-Choice Virginia, who said the bill failed “because it apparently did not go far enough for extremists who are determined to ban all abortion outright in Virginia.”

Last year, the state health board, dominated by McAuliffe appointees, partially rolled back rules adopted under former governor Robert F. McDonnell and Cuccinelli, both Republicans, that imposed strict hospital-style building codes on abortion clinics. Any other changes would require approval from the General Assembly, controlled by Republicans.

“Virginia women should be very concerned — it seems as though the only thing that stands in front of new restrictions on women’s access to health care is Terry McAuliffe,” said Anna Scholl, executive director of the left-leaning Progress Virginia.

Advocates note that McAuliffe’s term is half over and say they are playing a long game. Olivia Gans, president of the Virginia Society for Human Life, a state affiliate of the National Right to Life campaign, said it took advocates 20 years to pass a parental-consent law in Virginia.

“Hopefully, when there’s a ­pro-life governor in office, we’ll be able to see not only the passage but also the signature of this bill into law,” she said of the 20-week ban.

The Republican front-runner for the 2017 nomination is strategist Ed Gillespie, who nearly unseated U.S. Sen. Mark Warner (D-Va.) in 2014 on a purely economic message.

He opposes abortion.