Mayor Marion Barry, acting in the wake of a court order that limits the D.C. Jail population to almost 1,000 inmates fewer than are there now, said the District would refuse to accept any more prisoners from the courts if the overcrowding impasse is not resolved by the court-imposed Aug. 22 deadline, a Barry administration spokesman said yesterday.

The statement appears to place the fate of the excess inmates in the hands of the U.S. attorney general, who Barry administration officials said has legal charge of all persons charged and convicted of crimes in the District.

Annette Samuels, the mayor's press secretary, said Barry "made it very clear" in a meeting with criminal justice advisers yesterday that "if a solution to the situation has not been found in cooperation with the U.S. attorney and the attorney general and others by . . . the deadline . . . the mayor will have no alternative but to direct [corrections department Director James F. Palmer] not to accept any more prisoners."

For the second time this week, Barry asserted that prisoners in the District fall under the custody of the attorney general.

At a press conference Tuesday the mayor said: "As you know, prisoners are technically in the custody of the attorney general."

At the time, the mayor did not specify what the implications of that technicality might be. However, after meeting with his Criminal Justice System Board to discuss U.S. District Judge William B. Bryant's jail order, the mayor indicated the attorney general and U.S. attorney "have an integral part" in resolving the problem.

His statement appeared to suggest the federal officials would have to assume responsibility for inmates if the District declines to accept any more into its corrections facilities.

The D.C. Code provides that all prisoners convicted in the District for any offense "shall be committed . . . to the custody of the attorney general of the United States or his authorized representative, who shall designate the places of confinements . . . . "

T.J. Reardon III, principal assistant U.S. attorney, termed the press secretary's statement "ironic" in light of efforts by the U.S. attorney and others over a period of years to pressure the city to provide new prison space.

"We have cooperated with the city in the past and we will be doing so now and in the future," Reardon said. "The fact of the matter is, I would have thought that the mayor may have wished to emphasize what he was going to do in regard to the Department of Corrections' search for alternatives in the District of Columbia."

Samuels said no proposals of alternative sites for overflow prisoners were discussed in the meeting yesterday. A working group of the board will meet tomorrow to discuss such proposals, she said.

The court order, which bars referring any new inmates to the jail until its population of about 2,560 inmates is cut to 1,693, came partly in response to population increases resulting from court-imposed limits on inmate population at the city's Lorton prison in Fairfax County.

The caps at Lorton have resulted in 710 sentenced felons being held at the jail, which was built to hold pretrial detainees and misdemeanants serving short terms.

In the wake of the court order, there is a two-pronged effort under way by the District government to provide more space for prisoners. A commission named Tuesday by the mayor and City Council is to examine the need and possible sites for a major prison in the District. Meanwhile, Bryant's ruling creates a need in the short-term for space to house the 1,000 jail inmates.

Various sites have been mentioned by criminal justice officials, but none has received the stamp of approval from the Barry administration. Audrey Rowe, the D.C. commissioner of social services, said yesterday the conversion to adult use of Cedar Knoll, a District juvenile detention facility in Laurel, was an idea that has been "in the hopper" but that no decisions have been made concerning it.

Mary Lynn Walker, trustee for American Federation of Government Employees Local 1550, which represents corrections workers, said her organization had discussed the possibility of suggesting the use of Oak Hill Youth Center, another D.C. juvenile facility in Laurel, as well as military detention centers in the area.

A spokesman for Fort George G. Meade said, however, that the Installation Detention Facility there, which serves all service branches in a seven-state region, has space for only 55 persons.

Increased referral of District prisoners to the Federal Bureau of Prisons has been mentioned by some officials, but Pat Sledge, executive assistant to bureau director Norman Carlson, said the agency is not considering it.

"We haven't been asked," she said. "If we were to be asked I don't know what our answer would be. We just don't have room for an additional 1,000 inmates . . . . We are 38 percent over our rated capacity now."