Mayor Marion Barry and Edwin King, the chairman of the Prince William County Board of Supervisors, signed an agreement yesterday requiring that District officials notify the county of any disturbances or escapes at Lorton Reformatory.

The agreement was intended to address the complaints of Prince William residents and elected officials that D.C. corrections officials have failed to keep them posted about problems at the city-run facility, located in Fairfax County only 1 1/2 miles from the Prince William line.

In another development yesterday, D.C. Department of Corrections officials said they have transferred more than 35 felons from the D.C. Jail to a newly refurbished, previously unused medium-security dormitory building at Lorton's Occoquan III facility.

Leroy Anderson, a department spokesman, said 35 inmates were moved Thursday and an unknown number were moved yesterday.

Anderson said the move was made without incident, unlike another attempt last month to increase the inmate population at Occoquan I and II. On May 22, inmates threw beds out of dormitories and set mattresses afire after officials tried to place additional beds in dormitories that critics say are overcrowded.

The Occoquan units are the only D.C. prisons for adult felons not under court-ordered inmate population limits.

The D.C.-Prince William agreement is similar to one already in effect between the District and Fairfax County. Residents of both Virginia counties have expressed discomfort for years about having the prison in their midst.

"If the escapees go south from Lorton, they have to go through Prince William," said county Supervisor Rick Phitzner. "There's been some concern about Lorton, especially in the town of Occoquan.

"In the past, the only way we've gotten notification of an inmate disturbance is from monitoring Fairfax police radio," Phitzner said. "When 10 or 12 police vehicles would go rolling up to Lorton, then we'd know something was amiss. We want the same courtesy of notification extended to us as Fairfax has."

The agreement, signed on the prison grounds, requires the D.C. Corrections Department to notify the county of "all confirmed escapes, apprehensions of escapees and major disturbances at Lorton," Barry said.

Under the agreement, the District and Prince William each will appoint an official to attend quarterly meetings about Lorton.