A federal jury in Alexandria decided last night that Prince William County wrongfully held about 7,000 prisoners in unconstitutionally overcrowded, unsafe jail conditions between August 1980 and January of this year.

The six-member jury, which deliberated for five hours, rebuffed county claims that state corrections officials named as defendants in the suit, who run Virginia's own crowded prison system and oversee local jails, should shoulder or at least share liability in the case.

"It's fine, it's fine," said a jubilant Victor Glasberg, an American Civil Liberties Union attorney who participated in the three-day trial, after the verdict.

The ACLU victory came in one of only a small number of cases in Virginia in which both pretrial detainees and those convicted of felonies and misdemeanors have sought and won the right to money damages for confinement in allegedly unconstitutional conditions. Attorneys on both sides said last night's verdict is expected to encourage more such suits nationwide.

U.S. District Judge Richard L. Williams said a separate hearing to set damages will be scheduled within 30 days, but strongly suggested the two sides attempt to settle the amount out of court.

"If you come back to court, you'll get a speedy disposition of the case , I can assure you of that," Williams said.

Williams set the stage for a verdict favorable to the state defendants when he ruled that state employes are immune under the 11th Amendment from civil damages in their role as officials. Williams kept them in the case as individuals, but instructed the jury that the employes were entitled to claim they had acted in good faith.

The suit was initiated by the Virginia ACLU after two prisoners, Crayton E. McElveen Jr. and Geary Lee Jamison, complained that overcrowding and poor sanitation were causing skin disease and eye infections among prisoners forced to sleep on mattresses on the floor.

In two days of testimony, ACLU lawyers contended the jail regularly exceeded its capacity of 30 prisoners by up to 400 percent, confining inmates in space as little as 6 square feet per person. "It's a pigsty," said attorney Marilyn Rose in her closing argument.

Rose contended both county and state officials failed to act to correct conditions in the jail because of "bureaucratic excuses."

In their defense, lawyer James A. Welch and assistant county attorney John Foote acknowledged the overcrowding, but said good-faith efforts by the county supervisors to build a new jail had been under way since 1976. A new $5 million detention center, to be shared by the county and the city of Manassas, is expected to open shortly.

County officials instead painted Virginia corrections officials as the villains. Both Sheriff C.A. Rollins and his chief deputy, Dale J. Potts, testified they had repeatedly asked state corrections officials for help in reducing the jail's population, but had been unsuccessful. Both said the number of state prisoners lodged in the jail regularly ranged as high as 15 to 20 percent of the inmates.

Virginia officials contended the state was itself a victim of a prison population explosion since the mid-1970s that made them unable to accept prisoners for months after their felony convictions.

"We were trying to put two gallons of water in a one-gallon can," said former state corrections chief Terrell Don Hutto. Hutto said problems of prison and jail overcrowding took "almost all of the Department of Corrections' time and all of the state's corrections resources."

ACLU attorney Glasberg contended, however, that actions by state officials were inadequate. Reading from a 1978 state Board of Corrections option paper, Glasberg said Virginia officials knew then that the Prince William jail staff suffered from low morale and that jail conditions were becoming volatile. Still the state was content to wait four more years, Glasberg argued, until a new jail could be completed.