Virginia Attorney General Mark R. Herring delivers remarks during a town hall meeting by the Council on American-Islamic Relations at the Dar Al-Hijrah Islamic Center on March 17, 2017, in Falls Church, Va. (Paul J. Richards/AFP/Getty Images)

Virginia Attorney General Mark R. Herring has filed a motion to dismiss a federal lawsuit challenging a raft of state restrictions on abortion.

The lawsuit, filed in June by Planned Parenthood and like-minded groups, put Herring (D) in a politically awkward spot as both a vocal supporter of abortion rights and the statewide official tasked with defending Virginia in litigation.

In the motion filed Friday, Herring seemed to walk a fine line — noting the plaintiffs’ “powerful arguments” against certain abortion restrictions while also contending that the place to challenge them is the legislature, not the courts.

“Many of the challenged laws are decades old, some of the challenged regulations are under active review, and plaintiffs make powerful arguments that certain other requirements warrant reconsideration by the Virginia General Assembly,” the motion states. “But a federal courtroom is not the proper venue for debating the wisdom of these policies.”

When the suit was filed, some of Herring’s Republican critics raised the possibility that he would side with the plaintiffs and refuse to defend the state’s restrictions on abortion, recalling his decision in 2014 to support a lawsuit challenging Virginia’s now-defunct ban on same-sex marriage.

“We strongly urge Attorney General Mark Herring to defend the laws of the Commonwealth with the full force of his office,” House Speaker Kirk Cox (Colonial Heights), Majority Leader C. Todd Gilbert (Shenandoah) and other House GOP leaders said in a statement issued in June. “Should he once again neglect his duty to do so, the Speaker will consider using his authority to hire counsel to defend the law on behalf of the House of Delegates.”

On Friday, Gilbert expressed his pleasure with Herring’s decision, albeit in a backhanded way.

“Virginia’s pro-life laws are so reasonable, sensible and constitutionally sound that even a pro-abortion Attorney General who accepted tens of thousands of dollars from Planned Parenthood feels they must be defended,” Gilbert said in a written statement.

The House Republican caucus quickly took to Facebook, claiming credit for Herring’s decision in a fundraising appeal.

“WE DID IT! After thousands of you signed the petition asking Attorney General Mark Herring to defend the lawsuit filed by extreme pro-abortionists — today he announced that he filed a motion to dismiss the lawsuit!” it reads. “This won’t be the last attempt to undermine Virginia’s pro-life laws, with your help we will be ready. Will you donate now to help build momentum to protect Virginia’s pro-life laws?” The post also includes Gilbert’s language about “a pro-abortion Attorney General.”

Victoria Cobb, president of the conservative Family Foundation, reacted to Herring’s decision with suspicion: She said the attorney general was trying to “save the abortion industry” from itself by quashing a lawsuit that was “poorly timed,” given the retirement of U.S. Supreme Court Justice Anthony M. Kennedy, who has been a swing vote on abortion.

Planned Parenthood Federation of America issued a statement that noted Herring’s support for abortion rights as well as his duty to defend state law in most cases.

“We recognize Attorney General Herring is a staunch champion for women’s health, and he also has a duty to fulfill,” the statement said. “The people of Virginia elected him into office to do a job and we expect that he will ensure a fair process in defending the laws left behind by his predecessors.”

In 2014, Herring said that he could not defend the state’s ban on same-sex marriage because he viewed it as unconstitutional. That was before the Supreme Court legalized same-sex marriage nationwide in 2015, but Herring said he was building upon earlier high court rulings that signaled the justices were headed that way.

But he does not view the constitutionality of the abortion restrictions as in doubt, noting in the motion that the Supreme Court has already upheld some of them, including a waiting period and a requirement that only physicians perform abortions.

“Plaintiffs have raised a number of cogent policy objections that warrant prompt and careful consideration by Virginia lawmakers and regulators,” Herring’s motion states. “But well-established principles of federal court jurisdiction prevent plaintiffs from challenging provisions that do not harm them, and current Supreme Court precedent forecloses plaintiffs’ constitutional challenges.”

The abortion lawsuit, filed in U.S. District Court in Richmond, contends that some of Virginia’s restrictions on abortion are medically unnecessary and, therefore, unconstitutional in the wake of a 2016 Supreme Court ruling in a Texas case. In that case, the justices found that certain restrictions Texas had imposed in the name of protecting women’s health were medically unjustified and intended to make abortions harder to obtain.

Among the restrictions the current lawsuit challenges: that clinics meet hospital-style building standards; that physicians — not nurse practitioners or physician assistants — perform abortions; and that all second-trimester abortions take place in hospitals instead of medical offices.

It also takes aim at a 2012 law requiring women to undergo an abdominal ultrasound and then wait 24 hours before getting an abortion.