The District will face another crowding crisis in its prisons if the U.S. Justice Department goes ahead with the expected cancellation of a four-month-old agreement that allows newly sentenced prisoners here to be sent to federal institutions, officials said yesterday.

"We are dependent on the federal government staying with us and continuing the agreement until we can solve our short-term housing needs," a high-level city official said. If the agreement is ended, he said, the District will have to resort to packing more inmates into the city's prisons -- many of which have court-imposed population ceilings -- and will almost certainly face a contempt of court charge.

In August, a federal judge gave the District three months to reduce the number of inmates at the D.C. Jail from about 2,600 to 1,694. The city met that goal, largely because the Justice Department agreed to relieve the growing jail population temporarily by sending newly sentenced inmates to federal lock-ups.

The District now appears to be headed for a showdown with Justice, which has said that the agreement will be canceled this week.

City officials said that Justice wants to cancel the program because it cannot accept inmates for the three years it is expected to take for the city to build a new 1,000-bed prison in the District.

A Justice Department official said the government's decision to end the agreement was prompted by city inaction concerning the crowding problem.

The city "continues to expect the Justice Department to bail them out from what is a local prison crisis," a federal official, who asked not to be identified, said yesterday. "The city has a certain responsibility to plan for housing more inmates and has not made an effort to deal with it."

Ending the agreement will force the District into taking action, he said, adding that "if the federal government does something, the city will do nothing."

D.C. Mayor Marion Barry has asked to meet with Attorney General Edwin Meese III. And a city official, who spoke on condition that he not be identified, said yesterday that Barry will ask Meese not to cancel the agreement. The official said that notice ending the program is expected to be delivered to the city by Wednesday, but that it is not known if the cutoff will be immediate or gradual.

When Justice officials agreed to take the inmates, it was with the understanding that the city would study the crowding problem and look into the possible construction of interim modular housing and alternatives to incarceration.

Last week, District Court documents under seal since Oct. 28 were made public and revealed that the city intends to construct a new 400-bed facility within the currently existing Central Facility at Lorton Reformatory, the District-operated prison complex in Fairfax County.

Virginia politicians, many of whom have long pressed for removing the institution from their state, immediately blasted the idea, and Fairfax County Board of Supervisors Chairman John F. Herrity accused the District of "duplicity" for keeping the proposal secret.

City officials said that the facility will be a "temporary" one to hold prisoners until the District constructs a new prison in the city.

If the federal government stops taking the city's inmates, "there are not a lot of options," a city official said. "We are not going to release people into the streets prematurely or put people into halfway houses who don't belong there" -- which leaves incarceration as the primary alternative, he said.

Under the agreement with Justice, more than 1,580 sentenced inmates were sent to federal institutions from Aug. 24 to Dec. 31, the official said. Combined with District inmates who have been released from federal prisons and those who might have been sent to one regardless of the agreement, federal institutions last year accepted about 900 more of the city's prisoners than in previous years.

If the agreement is canceled, the city will have a new influx of about 60 to 90 inmates per week and once again will have to explore alternatives to imprisonment that were used to help reduce the population at the D.C. Jail last fall, such as speeding up paroles, sending more prisoners to halfway houses and releasing more inmates awaiting trial.

Still, according to District officials, the city will not be able to release prisoners at the same rate that it imprisons them, and the only alternative will be more crowding at the D.C. Jail and the eight facilities at Lorton, three of which also have court-imposed population caps.

The only apparent solution, a federal official said yesterday, is a new prison in the District, which he said has been delayed by the city's refusal to deal with the sensitive issue of where to build it.