The Virginia General Assembly has agreed to compensate individuals who were forcibly sterilized under the 20th-century practice of eugenics.

A budget passed by both chambers Thursday, and awaiting the governor’s signature, sets aside $400,000 — or $25,000 for each victim or his or her estate.

The appropriation, championed this year by Del. Benjamin L. Cline (R-Rockbridge), makes Virginia the second state to take such action among more than 30 that forcibly sterilized residents. North Carolina was the first.

“I’m very pleased we’ve finally taken this necessary step towards acknowledging the wrongdoing that was done by the state,” Cline said. “When someone is denied the ability to have a family, that’s a tragedy, but when it’s denied to them by their government, that is a scandal and a wrong that needs to be made right.”

Gov. Terry McAuliffe’s spokesman, Brian Coy, declined to say whether the governor favors compensation. While running for office, McAuliffe (D) said he supported the formal apology offered by Virginia for eugenics, but he did not take a position on payouts.

The Virginia Eugenical Sterilization Act, signed into law on March 20, 1924, declared that “heredity plays an important part in the transmission of insanity, idiocy, imbecility, epilepsy, and crime.”

The law had the blessing of doctors and scientists at the University of Virginia and elsewhere. Under its provisions, people who were confined to state institutions because of mental illness, mental retardation or epilepsy could be sterilized as a “benefit both to themselves and society.”

More than 7,000 Virginians were sterilized between 1924 and 1979. Officials know of 11 victims who are still alive.

One of them is E. Lewis Reynolds, a Marine veteran from Lynchburg who was forcibly sterilized at the Central Virginia Training Center.

“I thank you all very much, more than you’ll ever know,” he said Friday during a news conference in Richmond.

Cline said the advancing age of survivors — including Reynolds, who is in his late 80s — motivated lawmakers to act quickly. The state Department of Behavioral Health will process claims and compensate victims and the estates of those who have died.

The measure was rare in that it attracted support from conservative groups such as the Family Foundation of Virginia and the Virginia Catholic Conference as well as the American Civil Liberties Union of Virginia.

During the 2013 legislative session, Del. Robert G. Marshall (R-Prince William) and Del. Patrick A. Hope (D-Arlington) — lawmakers who are diametrically opposed on many other issues — sought to compensate victims with $50,000.

Although the payouts would be half that under the proposed budget, Hope and Marshall applauded the symbolic move.

“The appropriations of money today will not undo past wrongs. It will necessarily fall short as a restorative remedy for the injustice of stealing from our fellow Virginians the gift of the ability to have children,” Marshall said.

Hope called eugenics a “repugnant part of our state’s history.”

Mark G. Bold, executive director of the Christian Law Institute, has lobbied the legislature while trying to assist those affected by eugenics. He said Virginia’s policy was upheld by the Supreme Court, which said in 1927 that “three generations of imbeciles are enough.”

The ruling gave Virginia and other states the constitutional authority to continue the practice.

The practice also influenced Adolf Hitler; within six months of coming to power, Bold said, Hitler adopted language almost identical to Virginia’s law.

“Although money does not restore the intentional harm perpetrated against these individuals by their own government, it does, however, provide a great level of healing and forgiveness,” Bold said.