The District government is nearly $50 million in arrears on payments to two federal agencies -- the Bureau of Prisons and St. Elizabeths Hospital -- for housing city prisoners and mental patients, according to federal figures.

Neither organization is pressing for payment or threatening to withhold service because unlike some federal aagencies, they draw the funds they need from the U.S. Treasury. That helps explain why the District government, deeply in debt and operating at a mounting deficit, is able to keep operating and meet its payrolls: Uncle Sam is a lenient creditor.

Independent auditors have calculated the District's cumulative deficit at $409 million, including an estimated $125 million in the fiscal year that ended Sept. 30. Mayor Marion Barry and his aides have accepted those figures as correct and have said they will need to raise $215 million in cash through new borrowing authority this year to stay solvent as the deficit mounts. What they have not done is to specify the creditors who have been left unpaid while salary, Medicaid and welfare checks continue to be covered.

The chief creditor turns out to be the federal government. That is a principal difference between Washington and other cities, such as New York and Cleveland, that have fallen on fiscal hard times: the District owes nothing to private banks who could cut off credit and nothing to bondholders who must be paid.

A spokesman for the Bureau of Prisons said the city owes that agency $23,947,000.77 in unpaid bills dating back to 1977. The District is obliged to pay about $1.1 million a month to the bureau to house more than 900 convicts -- mostly women -- for whom the city lacks facilities. Records compiled by the bureau show that no payment has been made for 15 months.

"Under the law, we have to take their prisoners," a bureau spokesman said. "We send them a quarterly bill, but they pay the money to the Treasury, not to us, so it doesn't matter to us if it isn't collected. We just keep the records."

At St. Elizabeths, the sprawling mental hospital in Anacostia, Harold Thomas, executive assistant to the superintendent, said the District owes $12.7 million from last year and $13.3 million for the first two months of the current fiscal year. The city is billed $142.60 per patient per day. The number of city patients at the hospital varies, but is expected to average about 440 a day in the current fiscal year.

Thomas said the unpaid account is "not a sensitive issue at St. Elizabeths" for the same reason it is not urgent at the Bureau of Prisons: the District makes its payments to the U.S. Treasury, not to the institution directly, so the hospital is not out-of-pocket if the city fails to pay. As a federal agency the hospital, like the Bureau of Prisons, draws its operating funds out of the Treasury, and the Treasury pays the hospital whether it has collected from the District or not.

Thomas said the District's budget for the current fiscal year includes only $22.5 million for the St. Elizabeths account for the entire year, an amount that will be far outstripped at the current rate of billings. But because the entire account is, from the hospital's point of view, a paper transaction -- into one Treasury ledger, out of another -- it will be "business as usual" when the allocation is exceeded, he said.

D.C. City Administrator Elijah B. Rogers said the unpaid accounts are "part of the cumulative deficit." He said that in the past, city budgets provided unrealistically low amounts for such services, so the budgets would appear balanced when they actually were not. "That's how this deficit came about," Rogers said. "Our new budgets are going to have realistic funding and show what it really costs. Let's break these bad habits that brought us to where we are."

Rogers and Mayor Marion Barry have acknowledged that at some point in the current fiscal year -- perhaps late next spring after the city repays $41 million in court-voided taxes on nonresident professionals, a payment for which no provision was made in this year's budget -- the District's cash obligations will exceed its ability to manipulate its bills, and funds will run out unless Congress gives the city new borrowing authority.