Horror stories of being pressed into service for dangerous undercover assignments, denial of promotions and unfair disciplinary action were aired in a federal court Wednesday by Hispanic FBI agents.

A total of 311 Hispanic agents out of 404 have joined in a class-action discrimination suit against the FBI, contending the agency discriminates against Hispanics on the basis of race, religion and national origin.Government lawyers, under cross examination, deny there is discrimination in the FBI and said transfers and promotions are made on the basis of merit and "the needs of the bureau."

Plaintiff lawyers said at least 60 Hispanic agents will testify at the non-jury trial before U.S. District Judge Lucius Bunton. The trial, now in its fourth day, is expected to last two weeks.

Special Agent Sam Carlos Martinez of El Paso sobbed on the witness stand when testifying he had been falsely accused of wrongdoing by his white supervisor - a member of the Church of Jesus Christ of Latter-Day Saints - while serving in Mexico City.

Martinez, who since has been exonerated of all charges, said he was the object of discrimination by his superior, John M. Walser, and two other Mormon FBI agents serving at the U.S. Embassy in Mexico City in 1985.

Martinez broke down when relating his troubles. He said he had been wrongly accused of trafficking in firearms, allegedly in violation of Mexican law, and of violating embassy security rules.

Martinez, a Roman Catholic Hispanic, said he was the object of discrimination because of his ethnicity and religion.

Martinez said Walser accused him of trafficking with firearms because he helped an FBI informant, called a "walk-in," sell two pistols so the informant would have funds to leave the country.

He said Walser also accused him of a security violation regarding one of the U.S. Marines stationed at the embassy. He said he was not even in town at the time of the alleged incident.

Under cross examination, Justice Department lawyer Alan Ferber questioned Martinez about his success in the agency and his rise to management level. Martinez said he had experienced minor discrimination before the Mexico City assignment, where he was assistant legal attache.

"Walser tried to ruin my career," Martinez said. "He badmouthed me at FBI headquarters and succeeded in getting me out of Mexico City."

Martinez said he believes he will never again be promoted by the FBI. He said the false statements by Walser and the false accusations against him are still a part of his official record.

An Hispanic FBI agent from the San Antonio bureau, Marvin Ruben Regolado, said Hispanics in the FBI are seldom given cases of their own to handle, are treated as second-class agents, and are denied training and promotional opportunities.

Regalado, who attended Amherst College and Stanford Law School on academic scholarships, told Bunton the FBI discriminated against him in assignments and transfers and forced him to take a Spanish test even though he did not enter the FBI under the language program.

The class-action suit was filed in January 1987 by Bernardo Matias Perez, 48, who is seeking $5 million in damages and a change in the way the FBI treats Hispanics.