RICHMOND — A federal trial opened Monday with activists challenging four state laws that restrict abortion, including requirements that clinics meet stringent licensing standards, that patients get an ultrasound at least 24 hours before an abortion and that only doctors perform the procedure in the first trimester.

Abortion is a relatively safe procedure for the woman, carrying less risk than a colonoscopy, plastic surgery or tonsillectomy, an expert witness testified for activists bringing the suit. Even some dental procedures pose greater danger.

“It is one of the safest medical procedures that exists,” Mark David Nichols, who performs abortions in Oregon, testified in a bench trial before U.S. District Judge Henry E. Hudson.

But under cross-examination, Nichols acknowledged there is no formal program to train midwives, nurse practitioners or physician assistants to perform abortions. In other states, they get what the state’s lawyer called “on-the-job” training, learning informally from a doctor but then going off to work unsupervised — and perhaps train others.

That seemed to catch Hudson by surprise. Isn’t there a “prepared curriculum” and an established “standard of competency?” the judge asked. Nichols said there was not.

While a spate of states have recently made access to abortion more difficult, advocates in Virginia are trying to make it easier. The case is being heard in an election year when Republicans are trying to hold onto their razor-thin control of the legislature and when abortion politics — dormant for the past few cycles — probably will be prominent.

Earlier this year, Del. Kathy Tran (D-Fairfax) caused an uproar when she filed a bill seeking to loosen restrictions on late-term abortion. During a hearing, she said the measure would allow abortion up to the moment of birth. Tran later said she misspoke, but Republicans attacked her failed bill as extreme.

Gov. Ralph Northam (D) added to the furor with comments on a radio show that Republicans, including President Trump, said was an endorsement of infanticide. A pediatric neurologist, Northam called the infanticide charge “disgusting.” He appeared to be talking about end-of-life care for a baby that is “not viable,” but he has never clarified his remarks.

Trump’s reelection campaign invoked Northam’s comments as recently as last week on Twitter: “Democrat Ralph Northam on late-term abortion: ‘The infant would be delivered. The infant would be kept comfortable. The infant would be resuscitated if that’s what the mother and the family desired. And then a discussion would ensue between the physicians and the mother.’”

The case in federal court in Richmond comes after Georgia, Kentucky, Mississippi and Ohio banned abortions after doctors can detect a fetal heartbeat, about six weeks — before many women realize they are pregnant. And Alabama has made performing abortions a felony unless a pregnancy seriously risks a woman’s health, with no exceptions for rape or incest.

In Virginia, Del. Robert M. Thomas Jr. (R-Stafford), facing a primary challenger from the right, said last week that he would like the General Assembly to follow Georgia’s lead if Republicans can maintain control of the legislature. A law passed recently in Georgia would outlaw abortions after a doctor can detect a fetal heartbeat but includes exceptions for incest, rape and situations of medical futility or where the health of the mother is at stake.

Northam responded swiftly. “My veto pen is ready and full of ink,” the governor tweeted.

Despite the political drama swirling around the issue, the lawsuit unfolded as a staid affair, without a single protester in sight. Lawyers skipped opening statements and jumped right into questioning Nichols.

The doctor acknowledged under cross-examination that he typically orders an ultrasound before abortions even though the test is not mandated in Oregon. He also said some of his patients have backed out of planned abortions after seeing an ultrasound image of the fetus.

Hudson seemed intent on moving things along.

Hudson, appointed by President George W. Bush, agreed with plaintiffs two weeks ago that first-trimester abortions are simple and safe enough to be performed without a physician. It was the first time a federal judge in the country had come to that conclusion.

But a week later, he vacated his own order to allow non-doctors to perform most abortions in Virginia, saying the issue should be decided in the trial, which is scheduled to last through June 6.

The lawsuit was brought by a coalition of abortion rights groups, including the Center for Reproductive Rights, the Virginia League for Planned Parenthood and several abortion clinics across the state.

The state Department of Health and the office of Virginia Attorney General Mark R. Herring (D) are defending the rules. The case has put Herring in an awkward position as both an advocate for abortion rights and the state official tasked with defending Virginia law. He did not formally recuse his office from the case but hired a private firm, Hirschler Law, saying he did not have enough staff to handle it.

Representing the plaintiffs, D. Sean Trainor of the Washington firm O’Melveny spent the trial’s opening hours questioning Nichols about the safety of abortion.

Under cross-examination by Hirschler President Courtney Paulk, Nichols said 16 states allow non-doctors to dispense medications used to induce abortions in the earliest stages of pregnancy, up to 10 weeks. Just five allow non-doctors to perform a procedure based on suction, which is typically used up to 16 weeks. No state allows non-doctors to perform the procedure known as dilation and extraction, which can be used up to the point of viability.

Correction: This story has been updated to reflect that Virginia Del. Robert M. Thomas Jr. (R-Stafford) said he would support a law similar to one passed recently in Georgia, which would outlaw abortions after a doctor can detect a fetal heartbeat but includes exceptions for incest, rape and situations of medical futility or where the health of the mother is at stake. The original story reported incorrectly that Thomas supported a law similar to one passed in Alabama, which does not make exceptions for victims of rape or incest.