Shortly before Christmas, the uncertainty and frustration of Maryland's faltering state budget hit home in a Montgomery County courtroom.

Two criminal defendants stood before Circuit Judge DeLawrence Beard without lawyers. The Public Defender Office, the state agency created to provide legal representation for indigent defendants, had run out of money to hire outside counsel because of budget cuts.

Beard called a short recess. He removed his black robe and stepped into the hallway. There, he buttonholed two private defense lawyers leaving the law library and brought them to the courtroom for a 30-minute hearing.

Beard's resourcefulness that day kept the wheels of justice moving efficiently. But his unusual action underscored a deep problem for the state's judicial system and government budget-cutters grappling with an estimated revenue shortfall of $423 million for this year.

Some publicly financed services, such as legal representation for the poor, cannot be substantially cut because of legal and constitutional mandates, lawyers and state officials said.

"As long as programs are mandated by law, we have to provide the money," said James B. Rowland, assistant to the secretary of the Maryland Department of Budget and Fiscal Planning. "We don't have much of a choice."

Beard's unconventional action last month came after the state slashed more than $1 million in November from the public defender's budget as part of a statewide belt-tightening plan.

Of the 12 district offices in the state, Montgomery County was one of the hardest hit by the cutback, said county Public Defender J. Theodore Weiseman. Since July 1, the Montgomery staff has shrunk from 69 to 52, Weiseman said. Of staff members who were lost, only two have been lawyers, but the loss of secretaries, investigators, interviewers and law clerks has increased the workload of the remaining lawyers and support staff, he said.

"I'm trying to figure out what cards are left," Weiseman said. "We can't do miracles."

In Prince George's County, the state budget cuts could force the Public Defender Office to postpone several death penalty cases until after the start of the 1992 fiscal year on July 1, said county Public Defender E. Allen Shepherd.

If state officials attempt to cut legal services for the poor, they could face lawsuits and "threats of real havoc" in the judicial system, said Augustus F. Brown, head of the Maryland Criminal Defense Attorneys Association.

Several recent U.S. Supreme Court decisions mandate that defendants charged with crimes punishable by a possible jail term have a constitutional right to legal counsel, said Paul Kemp, a Rockville lawyer. Taxpayers are legally obligated to provide that service, he said.

Lawyers' groups worry that cuts in government-mandated indigent legal services will shift too much of the burden to the private bar.

"Lawyers are more than willing to put forth their efforts to help with this budgetary problem, but there is a limit to what can be expected from the private bar," said Seymour Stern, president of the Maryland State Bar Association. "It's up to the government to fund the Public Defender Office or find a way to stop crime."

Stern said his organization plans to consider a resolution tonight urging Gov. William Donald Schaefer to shore up funding for the 20-year-old state agency. In addition, the proposed resolution would encourage the bar's 15,000 members to do more criminal defense work without charge, he said.

In Montgomery, about 13,500 cases are handled annually by the Public Defender Office. The office must turn to outside lawyers when there are multiple defendants in a case to avoid conflicts with legal representation. In recent years, because of drug arrests, a growing number of cases have involved multiple defendants, Weiseman said.

Bethesda lawyer Gary Diamond, one of the lawyers appointed by Beard to represent an indigent criminal defendant, said that he was willing to help in a pinch but that judges should not be forced to track down lawyers in corridors to assign cases. "This is no way to run the judiciary system," he said. "It's not the way it should happen."

An underfunded Public Defender Office also could force courts to revert to the old system of judges appointing private lawyers to indigent cases, lawyers said. Lawyers said that could clog the courts with more cases, many of which would be assigned to inexperienced lawyers who don't specialize in criminal law.

"I'm scared that if we go back to the old boys' network there will be situations where members of the legal community will say, 'If you do this case, I'll remember you next time.' That's not good," Kemp said.

This fiscal year, the state Public Defender Office received $31.4 million, an increase of about $3.3 million from the 1990 budget, Rowland said. The $1 million cut in the budget in November was largely funding for expert witnesses and outside lawyers in conflict cases.

Intense lobbying in recent weeks has produced a temporary budget reprieve, Rowland said. He said Schaefer has agreed to restore $650,000 of the agency's funding to pay for expert witnesses and outside lawyers.

Rowland said Schaefer plans to include the additional funds in a "deficiency appropriation" budget to be submitted Jan. 16 to the General Assembly. Such a budget would provide emergency funds for state agencies running in the red to continue operations through June 30, the end of the current fiscal year, Rowland said.

Maryland State Public Defender Steven Harris said the last-minute infusion should forestall other judges from having to resort to Beard's solution. "The people in authority realized that the Public Defender Office is necessary for an orderly court system," he said.

A long-term solution is needed, officials said. "This is an annual problem that won't go away," said Del. Timothy F. Maloney (D-Prince George's), a member of the House Appropriations Committee.

Some changes are being considered, including tighter eligibility requirements for clients, officials said. Brown said his organization also is working on a plan to provide reduced-cost legal services to the working poor, who may be ineligible for the state program.

The worsening slump in the economy, as well as a surge in violent crime and drug arrests, will increase demand on the "back end" of the criminal justice system, Maloney said.

"The popular perception is that the Public Defender Office provides lawyers for the bad guys. The truth is the courts can't function without public defenders."