Virginia lawmakers on Thursday afternoon passed a final version of a bill requiring ultrasounds before abortions, including new language making the procedure optional for rape and incest victims who have reported the crime to the police.

On Tuesday, the state Senate adopted an amendment to make the external ultrasound optional for women who become pregnant as a result of rape or incest, but only if they report that crime to police. Opponents said the amendment was problematic since not all rape victims report this crime out of fear of reprisal. All other women in Virginia would need to receive an external ultrasound before being able to have an abortion.

The final bill passed 21-19 in the Senate, which is evenly split between the two major parties, with two Democratic senators voting in favor and a Republican senator voting against. In the GOP-controlled House, two Democratic delegates voted in favor, and one Republican dissented.

The bill now goes to Gov. Bob McDonnell, a Republican, who is expected to sign the measure.

The passage of the legislation was swiftly attacked by Democratic lawmakers in Richmond.

"This is a significant blow for Virginia women, whom legislative Republicans seemingly cannot trust to make their own medical decisions without the General Assembly's intrusive meddling," Del. Jennifer McClellan (D-Richmond) said in a statement. "The supporters of this measure do not have medical facts or public opinion on their side. Their only goal is to intimidate women and appeal to a narrow, extremist base."

The bill had become known for requiring as a prerequisite for an abortion a mandatory ultrasound at any stage of a pregnancy, initially specifying a transvaginal ultrasound for the early stages. Republican legislators and McDonnell dropped the mandatory transvaginal component following a national uproar. McDonnell said last week that he did not know the transvaginal component had been part of the bill.

After that change, state Del. David Albo (R-Fairfax Station) said during a floor debate last week that the national controversy over the transvaginal ultrasound plan had caused his wife to decline to have sex with him.

The bill's passage comes days after Alabama lawmakers discarded a transvaginal mandate from a similar bill. Rachel Maddow reported that the language was dropped after Alabama Gov. Robert Bentley, a Republican, told The Huffington Post he was unfamiliar with the bill.