A controversial bill that would require women to get an ultrasound before an abortion is now in doubt after Virginia Gov. Robert F. McDonnell diluted the measure Wednesday by making it optional in many cases.

The legislation initially sought to require ultrasounds, which early last week prompted opponents to raise concerns over the procedures’ potentially invasive nature. In many cases, the ultrasounds would require a vaginal probe to establish gestational age.

On Wednesday, citing concerns over that intrusiveness, McDonnell (R), an abortion opponent who had repeatedly said he would sign the bill, asked state lawmakers to amend the measure. House members approved the governor’s amendments, but the bill’s Republican sponsor in the Senate said she would try to pull the measure for the session.

“Mandating an invasive procedure in order to give informed consent is not a proper role for the state,” McDonnell said in a statement. “No person should be directed to undergo an invasive procedure by the state, without their consent, as a precondition to another medical procedure.” He did not comment further.

Confusion over the legislation and ultrasounds — and considerable national media attention — preceded the unraveling of the bill. The original measure stated, simply, that a woman needed an ultrasound before an abortion. Many lawmakers did not understand that at the young fetal age abortions usually occur, the invasive vaginal ultrasound would be needed to establish gestational age, as required by the bill.

McDonnell, who is often mentioned as a possible presidential running mate, tried to strike a balance between supporting his conservative base and supporting a bill that immediately drew opposition as a severe end-run against abortion rights.

“Bob McDonnell’s political future is not enhanced by vaginal ultrasound legislation,” said Stephen Farnsworth, a professor of political science at the University of Mary Washington. “But make no mistake about it: Governor McDonnell was painted into this corner by his own Republican legislature. This is an example of that old adage, ‘Be careful what you wish for.’ ’’

Republican lawmakers on Wednesday in essence said that an abdominal — or “jelly-on-the-belly” — ultrasound before an abortion would still be required but that vaginal ultrasounds would be voluntary.

The decision was a rare — and small — victory for Democrats and abortion-rights supporters after Republicans took control of both chambers of the General Assembly last month.

Democrats tried to kill the bill, saying the amendments only made the legislation worse, but Republicans cut off debate.

“Remember how we got into the mess to begin with,” said Del. Jennifer L. McClellan (D-Richmond). “Because when legislators wrote a bill, they didn’t understand the medicine.”

The measure now heads to the Senate, which had passed the unamended version once. Sen. Jill Holtzman Vogel (R-Winchester), who introduced the measure, said she did not realize that the ultrasound would not be external, and she said she still was not certain that would be required under the legislation. But she said she would move to strike her bill because of that uncertainty. That would require a Senate vote. Another version of the bill has been passed by the House and awaits Senate action.

“I had no concept about this other issue,’’ she said. “It didn’t come up in the committee, it didn’t come up in the subcommittee. I’m still not sure if it’s right or not right.”

Other abortion-related bills are pending during the 60-day legislative session. Bills ending state subsidies for low-income women to abort fetuses that have serious birth defects and giving rights to a fertilized egg at the moment of conception are working their way through the legislature.

Nighttime negotiations

McDonnell’s announcement came a day after legislators and governor’s staff members, including Chief of Staff Martin Kent and Secretary of Health Bill Hazel, huddled in his office Tuesday night to hash out a compromise after learning that some ultrasounds could be more invasive than first thought.

“I think these amendments . . . will resolve much of the controversy in the bill,” said Del. David B. Albo (R-Fairfax), chairman of the House Courts of Justice Committee, who introduced the amendment on McDonnell’s behalf.

The bill has been derided on TV, including “The Daily Show with Jon Stewart” and “Saturday Night Live,” and was the subject of protests on Capitol Square on Monday.

Republican scolds his party

Del. Robert G. Marshall, a candidate for U.S. Senate, took to the House floor on Wednesday to chastise his colleagues for letting media attention change their mind on ultrasounds.

“Instead of confronting the misinformation that’s going on here, some Republicans want to back away from this,’’ said Marshall (R-Prince William). “Instead of confronting the public with the truth, the whole truth and nothing but the truth, we — the descendants of those who fought the British empire — are sounding the call for retreat.”

The House and Senate have already approved versions of the bill, even after lawmakers spent weeks arguing that it would subject women to unnecessary tests, invade their privacy and cost them money.

It wasn’t until opponents of the bill recently began to graphically detail the invasive nature of ultrasounds in early pregnancies that McDonnell took a second look.

Tarina Keene, executive director of NARAL Pro-Choice Virginia, said that after years of lobbying legislators on similar bills, she didn’t know the ultrasound would be a vaginal one until a colleague at the National Women’s Law Center informed her the first week of the session.

Keene said she encouraged Sen. Ralph S. Northam (D-Norfolk), a doctor who was asked to oppose the bill in the Senate on behalf of Democrats, to talk about how women would need a vaginal probe.

Until then, she said, “we had a hard time messaging why it was bad.”

Sen. George L. Barker (D-Fairfax), who has a background in health care, said he knew that in the earliest stages of pregnancy, only an internal ultrasound could pick up images of the fetus, and he also approached Northam.

Language shifts

On Jan. 31, when the measure came up for a vote in the Senate, both men raised the issue during the floor debate — but very delicately. “We tried to be a little sensitive with the language, particularly when you have the [Senate] pages sitting behind you,” Barker said.

The Senate passed the bill. But when it came to the House committee nearly two weeks ago, lobbyists and legislators began using words including “probe” and “vaginal.”

The news spread across Capitol Square and across the nation with news shows reporting on the Virginia General Assembly and 1,200 protesters converging on the state Capitol. The language grew more explicit as more commentators and comedians picked up on the controversy of the probe.

Until Saturday, McDonnell and his aides had said the governor would sign the measure if it made it to his desk. But the governor, who as a legislator authored the state’s informed-consent law, said he began to take a harder look.

He said he took a few days to discuss the specific language of the proposed legislation with other governors, doctors, lawyers, legislators, advocacy groups and others before announcing his decision Wednesday.

Staff researcher Madonna Lebling contributed to this report.

Read more from The Washington Post:

George Huguely guilty of 2nd-degree murder

National Harbor casino criticized

Capital Bikeshare hopes for 5 stations on Mall

McCartney: Self-defeating smear against Girl Scouts