The Federal Bureau of Investigation suffered a major embarrassment Friday when a U.S. district judge ruled that hundreds of Hispanic-American agents have been discriminated against and regularly assigned to demeaning duties commonly known as the "taco circuit."

The ruling, issued here by U.S. District Judge Lucius D. Bunton, was heralded as a landmark case by the FBI agent who filed the initial suit, Bernardo Matias "Matt" Perez, assistant special agent-in-charge of the El Paso office."This case proves you can fight city hall and you can win," said Perez after reading the ruling. "I hope the FBI will look at this as a challenge to make these changes."

Although the class-action suit was decided in El Paso, its origins were in Los Angeles, where Perez filed his first discrimination complaint in 1983 during a prolonged dispute with then agent-in-charge Richard T. Bretzing.

Perez was Bretzing's top assistant for almost two years, and the two men clashed soon after their arrival in Los Angeles in 1982. Bretzing viewed Perez as unqualified for a top job in a large FBI office, and Perez saw Bretzing, a Mormon bishop, as mainly committed to boosting the careers of fellow Mormons.

Judge Bunton, in a 95-page ruling, rejected a separate claim of religious discrimination, but noted that some of the trial testimony supported "the proposition that Mormon supervisors made personnel decisions which favored members of their church at the expense of Hispanic class members."

In finding that the FBI had discriminated racially against Hispanics, Bunton stressed there was no evidence that the bureau had deliberately set out to do so. But he cited examples of Hispanic FBI agents who have been discriminated against and called on the bureau's director, William S. Sessions, to make some immediate changes.

"Corrections are necessary," the judge wrote. "There must be some fine-tuning of the Agency's relationship with its fine Hispanic members."

Responding to the judgment in Washington, Sessions said he was disappointed at Bunton's ruling. While holding out the possibility of an eventual appeal, he restated his position that "discrimination has no place in the FBI" and pledged to increase minority hiring and promotion.

"Regardless of the final outcome of this litigation, it is time to move forward," Sessions said.

In another response, U.S. Attorney General Dick Thornburgh pledged that he and Sessions "will use the findings in this case positively to ensure that the FBI and other federal agencies are toeing the line on every basis" to protect against discrimination inside their organizations.

The court ruling was particularly embarrassing to the FBI because one of its mandates as a branch of the Department of Justice is to protect civil rights.

Bunton found that Hispanics were in practice given unpleasant assignments that were rarely meted out to their white counterparts. These included being assigned to wiretaps that meant 12-hour days but were of little importance when it came to promotions within the agency.

He also said the evidence showed that Hispanics were most commonly placed as translators, even if they wished to enter some other type of investigative work where language skills were not a factor. Bunton cited as an example an agent with a Hispanic surname who spoke only rudimentary Spanish. Though a law school graduate, the agent spent six years on Spanish-language special assignments and was turned down for nine training programs.