The Prince William County Board of Supervisors, breaking a bitter internal stalemate, has agreed to build a $5 million regional jail on county land within the City of Manassas.

A four-member majority of the seven-member board had attempted to move the county seat out of Manassas and build a new jail, courthouse and administrative complex in the center of the county, but the plan was defeated in a spring referendum.

Underpressure from state courts and the Virginia Department of Corrections to replace its outdated, overcrowded jail, the board voted last week to accept an offer from Manassas for a regional facility.

The agreement calls for the jail to cost no more than $5 million, with Manassas paying 20 percent of the cost. The county's 80 percent share could be reduced if the City of Manassas Park agrees to join the project.

A Jail Board would be established with representation in proportion to the share in the cost oc construction.

The agreement was finally hammered out in a late night meeting on Tuesday of, last week between the Manassas Council and the county board.

The county accepted the proposal shortly before midnight on a 4-to-3 vote with former opponent James Byrd providing the swing vote.

"We have to build a jail . . . this is the best action the board can take," Byrd said of his decision.

Board Chairman Donald L. White, a strong supporter of the Manassas site, said, "I'm happy that we've made a decision. It's been needed for a long time and I'm glad we finally got the votes to move ahead with it."

Supervisors Kathleen Seefeldt and Alice Humphries said they opposed the agreement because Manassas was not making a large enough contribution.

County officials said they expect the jail would be built near the courthouse and would open in the summer of 1980. Present plans call for a capacity of 180 prisoners, with separate space for holding cells, work release inmates and maximum security prisoners. Juveniles will be housed in a separate facility.