RICHMOND, Va. (AP) — Hundreds of profoundly disabled people in Virginia will move from large, state-run facilities to community-based care while those who want to remain in the training centers will have court-ordered protections under a settlement that has received a judge's approval.

U.S. District Judge John Gibney signed off on the settlement between the state and federal governments late Thursday. On Friday, Gov. Bob McDonnell heralded it as "a significant step forward" for those with severe intellectual and developmental disabilities and said the state now could begin implementing the changes.

The $2 billion settlement agreement stems from a lawsuit the Justice Department filed against Virginia last year over what it called systemic violations of the Americans With Disabilities Act. The agency claimed Virginia violated federal law by needlessly warehousing hundreds of disabled people in large institutions scattered across the state instead of treating them closer to their families and in less restrictive settings.

After nearly a year of negotiations, the state and federal governments agreed to a deal earlier this year that called for the state to close four of its five training centers and create 4,200 waivers over 10 years to better serve disabled clients at home or in more intimate settings.

Some families opposed the deal, saying it would deprive their loved ones of appropriate care. They intervened in the case, leading to a protracted review that included a six-hour hearing in June. Those who opposed closing the facilities argued it would force them out and lead to subpar treatment and even death.

Gibney dismissed their claims, saying they "ignore a provision of state law that forbids the horrible outcomes they conjure up."

Virginia law bans someone from being discharged from a training center if the client or that person's authorized representative objects. Upon Gibney's urging, the sides added language that spelled out who qualifies as a representative and makes it clear that treatment providers or employees cannot make those decisions. A provision was added that if that law ever were repealed, the court could step in.

Gibney stressed that nothing in the settlement requires the state to close the training centers, but that it also doesn't prevent it. He recognized it was unlikely the state could afford to keep open the facilities and devote money to providing waivers for community care.

Virginia plans to keep one facility open for those who do not want to remain under state care.

"This matter is a judgment left to the Virginia General Assembly as it considers the state's various needs," Gibney wrote. "Nothing, however, forces the General Assembly to close down any facility."

An attorney for the families, Thomas B. York, did not immediately return a call and email seeking comment.

Language also was added at Gibney's urging to require the state to report deaths and serious injuries of former training center residents who leave state-run centers for group homes or other facilities.

The Justice Department first began looking at Virginia's methods of housing the severely disabled in 2008. On Friday, U.S. Attorney Neil H. MacBride said the department was committed to ensuring that the agreement is implemented fairly.

Those who support the settlement agreement argue it benefits thousands of Virginians awaiting services.

Because Virginia spent millions to run the five training centers, there was less to put toward Medicaid waivers: subsidies funded by the state and federal governments to pay for care and services in the community. The waivers can be used for anything from placement in group homes to purchasing medical equipment or part-time help for caring for a family member.

More than 3,600 Virginians are currently on an urgent waiting list for Medicaid waivers. Overall, more than 6,300 are awaiting waivers.

"Those citizens and their families must fend for themselves in dealing with disability," Gibney wrote.

Jamie Liban, executive director of The Arc of Virginia, said in a statement that the settlement will allow more people to receive services because it's so much cheaper to offer services in the community. It costs the state $225,000 per year to house someone in a training center, compared to about $69,000 to treat them in the community, Liban said.

It also will allow for better services, she argued, because it will allow many to "have a home, a job and a life in the community."

The populations in the training centers have dwindled from more than 6,000 in the mid-1970s to less than 1,750 in 2000. Today, there are fewer than 950.

Under the agreement, Southside Virginia Training Center in Petersburg would close by June 30, 2014; Northern Virginia Training Center in Fairfax by June 30, 2015; Southwestern Virginia Training Center in Hillsville by June 30, 2018; and Central Virginia Training Center in Lynchburg — the state's largest with 400 residents — by June 30, 2020. Southeastern Virginia Training Center in Chesapeake would remain open.

The Department of Behavioral Health and Developmental Services is proceeding with the schedule to close the centers and will develop plans for each individual who currently resides in the training centers, department spokeswoman Meghan McGuire said.