The District government, faced with a court order that would have prohibited sending any new inmates to the D.C. Jail, won a reprieve yesterday by promising to reduce the number of prisoners at the jail by nearly one-third over the next 90 days.

In an agreement approved by U.S. District Judge William B. Bryant, the city said the reduction of nearly 800 inmates would be carried out by speeding up paroles, sending more prisoners to halfway houses, releasing more people awaiting trial, and urging judges to reduce prison sentences.

In addition, as a temporary measure, the federal government has agreed to place all criminals newly sentenced by courts in the District into federal prisons.

Mayor Marion Barry, who signed the agreement after previously denouncing Bryant's order to reduce the jail's population, declared in a statement that "none of these new measures will endanger the public safety" by mandating early release of any dangerous or violent criminals.

In mid-July, citing "massive overcrowding" at the jail, Bryant ordered the city government not to send any new prisoners there starting Saturday unless the number of inmates was cut to 1,693. At the time, there were nearly 2,600 inmates in the jail; at present there are nearly 2,500.

Yesterday, Bryant agreed to let the city reach this figure in eight stages by Nov. 22. But he said that if the jail remains above any specified level for more than two days, the ban on admitting new inmates will automatically go into effect.

The timetable -- along with the steps the city said it would take to reach it -- was hammered out in a day of negotiations between city lawyers and attorneys for jail inmates who have pressed the litigation on prison crowding for over a decade.

D.C. Jail, located near Robert F. Kennedy Stadium, is the city's only facility for imprisoning newly arrested male suspects. The jail was planned to hold people sentenced for misdemeanors in addition to those awaiting trial. However, because of court-imposed limits at four of the District's other corrections facilities at Lorton in Fairfax County, about 40 percent of D.C. Jail inmates now are serving time for felonies.

Although Barry and other city officials had strongly criticized the judge's order last month and asked Bryant to vacate it, Acting Corporation Counsel John H. Suda announced yesterday that the city would no longer contest it if Bryant gave 90 days more for the District to carry it out.

"It will not be an easy task," Suda said, referring to the steps needed to reduce the jail's population. "But [the city] believes that is what's needed and will do it."

Steven Ney, an attorney for the National Prison Project of the American Civil Liberties Union who represented the plaintiffs, praised the agreement as a way to "stretch out for just a short period the time needed to implement the judge's order."

During a hearing Wednesday, at which the District asked for a 90-day delay without an interim timetable for compliance, attorneys for the inmates noted that cases about overcrowding in the D.C. Jail have been before the courts for more than a decade.

The plan approved yesterday makes no mention of constructing a prefabricated "modular jail" as an interim prison, which the city said it was "actively considering" in a letter submitted to Bryant on Wednesday. Suda said city officials had rejected the idea as "highly impractical."

Suda said the key steps in reaching Bryant's limit were the changes in the parole and pretrial detention procedures, plus the willingness of the federal government to take all newly sentenced prisoners. However, both city and federal officials said they were uncertain how long the federal commitment would last.

In a letter making the offer on Wednesday, Deputy U.S. Attorney General D. Lowell Jensen said the agreement to take prisoners sentenced in D.C. Superior Court "can only be for a short time, until modular cell construction or other alternatives can be completed by the District of Columbia."

Yesterday Barry declared that he was "pleased that we have had the cooperation of the federal government, which is our partner in the District's criminal justice system."

According to yesterday's agreement, the population of the jail will be cut to 2,200 by tonight. City officials said over 200 prisoners would be sent to halfway houses and about 75 transferred to Lorton.

By Sept. 1, the number in the jail will be reduced to 2,050, as the federal government removes about 150 federal prisoners from the jail.

After that, the number of inmates is scheduled to drop by 60 every two weeks. However, Hallem Williams, a special assistant to the city administrator who helped develop the plan, said the jail population would probably have to be cut somewhat more steeply than the court order specifies to maintain a cushion of 50 to 65 below the judge's limit to take care of emergencies.

Other steps promised by the city include:

*Parole hearings for all eligible inmates within 45 days and a promise that in the future the Parole Board will decide if an inmate can be paroled no later than 10 days from the time he becomes eligible for release.

*The capacity of halfway houses will be expanded to 736 by September 1986, an increase of about 500 places.

*Barry will urge Chief Judge Carl Moultrie I of the D.C. Superior Court to establish a system of reviewing the bond of all pretrial detainees within 10 days of their jailing. If such bond review hearings are not being held regularly by Sept. 30, city lawyers will request them.

*An extra $100,000 will be spent to expand third-party custody programs so that more persons can be released before trial.

*The city government will urge the Parole Board to "exercise regularly" its authority to petition judges to reduce their sentences "in all appropriate cases to reduce overcrowding."

*Expand job placement and furloughs to enable more prisoners to be paroled.

The agreement also commits Barry to make "an all-out effort" to gain City Council approval for a bill to let the mayor reduce all prison sentences by up to 180 days if the number of inmates in D.C. prisons does not remain at least 5 percent below their rated design capacity. The prison system now is operating at about 22 percent over capacity.