The District government not only balanced its budget in the last fiscal year but had $24.9 million in excess revenues in its general fund to help pay off its long-term deficit, and for the first time in six years did not have to subsidize its separate water and sewer fund, according to the city's annual financial report.

Mayor Marion Barry, clearly pleased with the city's fiscal affairs as they stood at the end of fiscal 1985, said that even with sharp federal budget cuts, the District will not return to the kinds of financial crises that faced his administration in 1979 and 1980. Then, he said, there were times the District had only enough in the bank to cover about half of the payroll.

The mayor said he will not have to raise taxes or lay off permanent full-time city employes, though "very difficult decisions" will have to be made on services.

"I don't think we will reach a crisis level . . . . We're in financially good shape," Barry said yesterday at a news conference to release the audit for fiscal 1985, which ended Sept. 30. It was released one day before the mayor's planned announcement of his proposed budget for fiscal 1987, which begins Oct. 1.

The financial report won the praise of City Council member John Wilson (D-Ward 2), chairman of the council's Finance and Revenue Committee and a longtime critic of the Barry administration on financial matters.

"It's better than it's been since I've been in office," Wilson said of the District's financial situation. "I'm happy that we're looking a lot better financially going into this Gramm-Rudman year," he added, in reference to the federal legislation requiring national deficit trims and sharp budget cuts. Wilson said he was particularly pleased about the turnaround of the water and sewer fund.

The water and sewer fund, separate from the general fund, had a deficit for five previous years, and the city approved large phased-in increases in water and sewer fees to customers in 1983. After five years of losses, in fiscal 1985 the fund had a $1.8 million surplus.

But several other operations not included in the general fund had to be heavily subsidized by the city, including the University of the District of Columbia, D.C. General Hospital and the Washington Convention Center.

The city paid $64.9 million of UDC's expenses of $88 million and $45.5 million of D.C. General's operating costs of $94.8 million, according to the financial report.

At UDC -- where the administration of former university president Robert Green was alleged to have misspent hundreds of thousands of dollars in university funds -- D.C. officials "are going to insist that they tighten up" and not be such a drain on District funds, the mayor said yesterday.

At D.C. General, the public hospital that serves the city's indigent residents, officials are looking for ways to attract more paying patients and to get D.C. government employes, who are covered by health insurance, to use it, Barry said. He denied a suggestion that the hospital has a "bad reputation" that would make this difficult.

Barry was more tolerant of losses at the Washington Convention Center, which took in revenues of $4.9 million and had expenses of $12.5 million, offset by a $5.7 million subsidy from the city. The center is still in its early stages when it is not expected to make money, he said, adding that it more than pays for itself in economic development around it and tax revenues generated by conventions there.

"I take full credit for it. I love it," Barry said.

The annual report, audited by independent accounting firms, gives a summary of the District's finances at the end of the fiscal year, and included these findings:

*The city took in revenues of $2.634 billion and spent $2.609 billion. The excess $24.9 million brought the accumulated general fund deficit down to $244.9 million.

The general fund deficit is the amount by which the city's assets are exceeded by its total liabilities.

*Property tax revenues of $455 million were $10.4 million higher than expected, and Barry attributed this mainly to higher assessments on commercial properties.

*Actual fiscal 1985 expenditures were generally very close to the amounts budgeted for different categories.

*The lottery had $112 million in business in fiscal 1985, up from $85.6 million the year before. After expenses and prize money awarded, the lottery made $35.5 million that went into the general fund.

*District employers saved $23.4 million in contributions to the unemployment compensation trust fund, in part because a federal advance to the fund was repaid, lifting a surtax on employers here.

*Investment earnings in the city's pension fund leaped from $38.1 million in fiscal 1984 to $119.7 million, mainly because of improvements in the stock market.