RICHMOND, Va. — Virginia’s process of evaluating sex offenders ready to be released from prison to see if they should be detained for treatment is so flawed that some could needlessly spend years locked up while others who tell officials they are likely to offend again are let go, according to a study released Monday.

The Joint Legislative Audit and Review Commission, the General Assembly’s investigative arm, said the risk assessment questionnaire used to assess the probability that offenders will commit another sex crime often overestimates that likelihood. But because Virginia’s law specifies the assessment must be used, legislators would have to change the law to fix the problem.

“There are people that are civilly committed that otherwise would never have reoffended, and that’s just the inherent limitations in this prospective decision,” Justin Brown, the leader of the JLARC study, told lawmakers.

Legislators earlier this year ordered JLARC to review Virginia’s civil commitment program for those deemed sexually violent predators. Lawmakers realized a 300-bed center that opened in 2006 soon would be full, and that it would require millions to continue committing offenders at the state’s current rate. It costs the state about $91,000 per year for each of the more than 280 offenders being held at a Burkeville psychiatric facility.

That number shot up dramatically in 2006, when lawmakers expanded from four to 28 the number of crimes that would make someone eligible for commitment. That’s also when Virginia began using a scientific risk-assessment tool called the Static-99 to evaluate those within 10 months of their prison release date.

The Static-99 involves 10 questions meant to predict the likelihood of a repeat sex crime. Offenders get points for predictors that range from their criminal history to whether they have lived with a lover for more than two years.

Since Virginia began using the Static-99, the number of those determined eligible for commitment jumped from about 7 percent of all sex offenders being released from prison to about 25 percent.

Offenders who score a 5 or above — or above a 4 if the crime included violence against children — are referred to a committee. Members evaluate the prisoner to determine whether to recommend that the Attorney General’s Office file a civil case to have the person declared a sexually violent predator eligible for commitment. A judge and jury make the final determination.

Meanwhile, Brown said the Department of Corrections has identified between three to five offenders each year who told evaluators they could not control the urge to offend and planned to again when released. But their scores were too low so they weren’t eligible for commitment.

Out of the 20 states with civil commitment programs, Virginia is the only one that relies solely on the Static-99 as a screening tool. Other states that use it allow mental health professionals to administer the test and determine if the offender is a real threat.

When the test was designated in law in 2006, it was believed that a score of 5 meant that the offender was 32 percent likely to commit another sex crime. Updates have brought that risk down to about 11 percent. Researchers say that even may be too high. The test isn’t as accurate assessing individuals as it is groups, Brown said.

A 5 could mean that the offender is anywhere from 4 percent to 92 percent likely to offend again.

“Are we saying that we’re guessing with these people?” asked Del. Johnny Joannou, D-Portsmouth.

“It’s better than a guess,” Brown said, “but the difficulty here is that for any one person it’s really difficult to know what they would have done.”

Brown recommended lawmakers remove not only the baseline score, but also the requirement that officials use the Static-99 from the law and replace it with “a current and scientifically validated” assessment tool.

The study recommended that more treatment be provided in prison. It costs the state about $22,000 per year to house an offender — four times less than commitment.

Virginia spent $24.5 million on its civil commitment program in the fiscal year that ended June 30. Gov. Bob McDonnell had suggested spending $43.5 million to build another facility and about $10 million more to open a closed psychiatric hospital to help handle the growing number of committed offenders. But legislators balked and instead demanded to know why the program had grown so exponentially.

So far, officials have retrofitted 150 of the 300 rooms at the Virginia Center for Behavioral Rehabilitation to double-bunk offenders, said Olivia J. Garland, deputy commission of the Department of Behavioral Health and Developmental Services.

Officials said they expect problems between residents and possibly assaults on staff to increase because of the double-bunking.