Mayor Marion Barry did a startling about-face last week. After weeks of campaigning on claims of being in control of the budget, after weeks of declaring that the dizzy days of multi-million dollar deficits, budget cuts and hiring freezes were over, he conceded that the District of Columbia might have a $6 million budget deficit at the end of this fiscal year.

Congressmen who keep watch over the city budget angrily claimed that Barry had "flim-flammed" them with his upbeat speeches about the shape of city fianances. They demanded an immediate explanation and threatened to hold up action on the city's $63.9 million budget supplement until they got one.

And the resurfacing of budget problems gave new ammunition to Barry's opponents in the race for the Democratic nomination for mayor, who lined up to shoot holes in his credibility two months before the crucial Sept. 14 primary.

Was there really a budget surplus last year, as Barry claimed? How well has he really handled the city's finances? The government? Has he merely glossed over big problems with a thin veneer of election year programs to clean up the streets, fix the potholes and promote Washington as a "Capital City"?

"It's all over town, there was quite a bit of talk about it at the car inspection station this morning," said City Council member John Ray, who spent Friday morning campaigning at one of the city's auto inspection stations. "People are all surprised because he had told them again and again that he could handle it, all was well. People feel foolish for falling for that. Now they're saying, 'oh, my goodness, here we go again.' "

Lawyer Patricia Roberts Harris had long been attacking Barry's performance as an administrator. The new disclosures increased the intensity of her criticism.

"If we want the taxpayers to support programs and have confidence in their government we must earn that confidence," Harris said in a speech Friday in which she termed Barry's handling of the budget a fiscal outrage.

"Good government, the kind we need and deserve, is government conducted openly, not in the shadows where false promises thrive, shady deals lurk and fiscal chicanery abounds," Harris said.

Barry's other major challenger in the primary, Council member Charlene Drew Jarvis, echoed concerns expressed on Capitol Hill.

"I feel like I've been flim-flammed. I think the people of this city feel like they have been flim-flammed," Jarvis said. "He Barry just hid the problem until he couldn't hide it anymore. The mayor has created for himself a real credibility problem."

For its part, the Barry campaign was uncharacteristically mum on the issue, with top political advisers not returning several telephone calls made over the past two days and press aides unreachable. The view of government aides was best summed up in a statement by City Administrator Elijah B. Rogers.

"We have a contingency plan. We've always had it, but I'm not ready to reveal it to you now," Rogers told a reporter Wednesday. "I'm telling you we are going to have a balanced budget or reduce the accumulated deficit. I have it under control. You can count on it." Rogers said he expects to release a status report by the end of this week.

This year's budget debate began somewhat inconspicuously, when Council member John A. Wilson (D-Ward 2), chairman of the Finance and Revenue Committee, noted a $2.6 million revenue shortfall based on May reports and, on that basis, predicted a $20 million to $40 million deficit by Sept. 30, the end of the fiscal year.

Barry vowed to prove Wilson wrong. On Tuesday, June revenue reports showed a cumulative shortfall of $12.9 million, but Barry minimized the significance, noting that the amount was only about 2 percent of the city's $1.6 billion operating budget and maintaining that there was a $10 million cushion to help avert a deficit.

By Wednesday, however, Barry had fewer words of comfort. "In a worst-case situation," the mayor told a reporter, "we'll maybe have a $5 million or $6 million problem for the whole year. Six million dollars out of a $1.6 billion budget is not really a problem."

Instead of dampening the growing sense of crisis, Barry's remarks drew angry responses from Congress and admonitions that the $10 million "cushion" that Barry referred to was actually earmarked by Congress as a first installment on repaying the city's $309 million accumulated deficit.

Wilson said Friday that the shortfall total by the end of June was higher than he thought it would be when he made his original projection of a $40 million deficit. He now thinks the deficit could be much larger.

In addition Wilson and several other council members said they suspect that Barry's city agencies are overspending their budgets and will add further to the deficit.

John Ray, after analyzing the Department of Transportaion budget to see where money was coming from for Barry's efforts to make street repairs, said that agency's budget is fast being overspent.

The council members said they suspect Barry is reluctant to make necessary cuts in city programs to bring the budget in balance because it might have a bad political impact on voters in an election year.

Rogers said he has ordered job openings left vacant as a way of cutting costs, but Rogers and Barry refused to release data on whether the city is keeping its spending within budget or to say what other reductions may be taking place.

On top of the angry response from city politicans, city union officials, including those supporting Barry, got edgy at the word that Rogers has imposed an unannounced virtual hiring freeze and is cutting purchases of equipment. Barry began his reelection campaign by pledging no layoffs for the next four years.

"Look, I don't know what Marion's doing," said one high-ranking union official, a Barry supporter who asked not to be identified. "But he's playing with people's jobs. It's people working in the city government that have to do the extra work when he's not filling vacancies. The way it looks he may not be able to keep that promise not to lay off anyone this year. The next four years is a joke."

In Congress, the reaction to Barry's new financial problem was a feeling of betrayal by members of the committees that oversee city affairs, who said they had trusted Barry's rosy reports on the budget.

"We want to stay out of District affairs as much as we can," said a member of one committee who asked not to be named because he feared his comments on the budget would become politically charged in an election year. "How can you stay out if you can't trust the man? He has taken us for a ride."

Philip M. Dearborn, a municipal finance specialist for the Greater Washington Research Center and former adviser to Barry, said the shortfall should not be taken lightly, in part because the city already has an accumulated deficit and a financial situation that worsens whenever that deficit grows.

"This kind of thing a shortfall in tax revenues can rapidly deteriorate in a bad economy," said Dearborn. "The $12 million is not an unmanageable amount. It's a real test of their ability to make a quick adjustment and get out of trouble . . . . In the past, this city has been in trouble because the government was slow to adjust."

Dearborn said it is difficult to make major budget cuts in an election year and even more difficult when there are only three months left in the fiscal year.

The new debate over the budget also has touched off a flurry of activity among some of the candidates to win an endorsement from Wilson, who backed Barry in 1978 but has been one of his most persistent critics during the 3 1/2 years that Barry has been mayor.

On Friday, Wilson, who ran a brief campaign for mayor before withdrawing in April, said he has been talking to Barry and will endorse a candidate by next Friday.

"I haven't made up my mind," he said. "I'm going to endorse somebody, but I'm still not sure who I want to endorse."