Over the last decade, says D.C. Mayor Marion Barry, the federal government has spent $50 million to get him and his administration. If so, the total tab for the Barry probes would dwarf those of some of the longest, most notorious and most complex criminal cases in recent U.S. history.

Los Angeles County officials, for example, say that through May they have spent $13.4 million to investigate and prosecute the McMartin Pre-School case, which began in 1983 with allegations that faculty members were molesting children at a school near Los Angeles.

That case included a preliminary hearing that lasted 18 months and a trial that lasted 31 months, with the county paying most of the legal fees for the defendants at the hearing and trial because they were too poor. Barry, in contrast, is paying for his defense.

Law enforcement officials have vehemently rejected Barry's estimates of the costs of the Barry investigation. The cost of 10 separate investigations of Barry or his associates from 1982 until now is $2 million to $3 million, they have said, a figure based on the salaries of those involved from the U.S. Attorney's Office, the FBI and the D.C. police department.

The most famous of the probes, the one that began with the Ramada Inn incident in 1988 and led to the Vista Hotel sting in January, and Barry's trial, "would not reach seven figures" in FBI salaries and travel expenses, said a law enforcement official who asked not to be identified.

The office of independent counsel Lawrence E. Walsh says it spent $20.9 million from its inception in December 1986 through May 31 of this year to investigate and prosecute former national security adviser John M. Poindexter, former National Security Council aide Oliver L. North and others involved in the Iran-contra scandal.

At its peak in 1987, Walsh's office employed 29 full-time lawyers and 73 staff members, and still has seven lawyers and 34 other employees. Its overall cost did not include the salaries of FBI and Internal Revenue Service agents assigned to work on the cases. At one point, 11 IRS agents and 35 FBI agents were involved, Walsh's office said.

Further, if the Barry investigations have cost $50 million, that would have been enough to employ 100 FBI agents working on Barry-related cases full time for 10 years, based on the current average salary of a field agent, $50,000.

A figure of $42 million apparently first surfaced in 1988 on the WOL-radio talk show hosted by Cathy Hughes. She said in February this year that she got the total from Barry and checked it with the U.S. Attorney's Office, where a woman -- whose name Hughes did not know -- confirmed it. Hughes said the woman said of the $42 million figure, "That's not exactly right, but close enough."

Then, last week, Barry raised the total to $50 million, saying it was "not for me to prove. It's for Jay Stephens to disprove." Lurma Rackley, Barry's press secretary, said the mayor was "giving an estimate" of the costs of all the probes of Barry administration officials and practices during the past 10 years. It includes, for example, the case against David E. Rivers, former chief of the D.C. Department of Human Services, and city contractor John B. Clyburn, which ended in acquittals.

Throughout the Barry case, its cost has lingered as an emotional issue on the periphery. Several local black commentators and community newspapers have accepted Barry's $42 million and $50 million figures as correct.

Prosecuting the Barry case are two assistant U.S. attorneys, Judith E. Retchin and Richard W. Roberts, who spent 80 percent of last year and all of this year preparing and trying it, according to their office. The average salary for a prosecutor is $73,500.

No estimate was available yet for the cost of the Barry trial, specifically the cost of hotel rooms and meals for the jurors, the salaries of deputy U.S. marshals and other expenses. But U.S. Marshal Herbert M. Rutherford said in December that it cost "just under" $750,000 for the 13-week trial of drug dealer Rayful Edmund III. That estimate included meals and rooms for the sequestered jurors, the cost of renting half a dozen cars for the trial and a daily round-trip helicopter ride for some defendants held at military bases.

Determining the total cost of pursuing and trying any case is difficult. For one thing, investigators and prosecutors would be paid no matter what case they were involved with, and there are fixed costs that rarely are factored in, such as wear and tear on vehicles.

In addition, investigators routinely work on more than one case at a time, complicating the apportionment of costs, and many investigations involve more than one government agency, which means more than one budget is involved.

Mike Kortan, a spokesman for the national FBI office, said the agency usually does not calculate the cost of any investigation when it is completed. A spokesman for the Justice Department could not be reached for comment.

The County of Los Angeles Department of Auditor-Controller, however, has kept track of some of the costs of many highly publicized cases, providing some context for the Barry case.

J. Tyler McCauley, chief of the department's audit division, said the county spent $1.6 million to bring to trial Angelo Bruno Jr., the "Hillside Strangler" who sexually tortured and killed nine women in 1977 and 1978.

That figure does not include the cost of catching Bruno, who was the object of a massive search by many southern California police departments, each of which ran up investigative expenses, McCauley said. It represents instead all of the costs incurred by the county once Bruno was caught, including the salaries of investigators involved in preparing the indictment; the salaries of prosecutors from the District Attorney's Office; and the cost of bringing expert witnesses to the trial.

Likewise, McCauley said Los Angeles County spent $1.8 million to prosecute Richard Ramirez, the "Night Stalker" convicted in September of 13 murders. His trial took 14 months and involved 130 witnesses. Again, the total does not include costs before his arrest.

There was no search for Sirhan Sirhan, who was apprehended immediately at a Los Angeles hotel after shooting Sen. Robert F. Kennedy in 1968. The county spent $593,000 bringing him to trial for murder in 1969, McCauley said. Adjusted for inflation, that would be slightly more than $2 million today.

In the McMartin Pre-School case, the estimate of $13.4 million does not include the costs of a second trial, which concluded last week. It does include much of the investigative work that was done before the initial indictment in 1984, McCauley said, though not the costs to a local police department that also was involved.

Staff writer Tracy Thompson contributed to this report.