At the age of 47 and after practicing law in Denver for 14 years, Robert E. Olsen embarked on a new career. He joined the State Department and was assigned to the U.S. consulate in Sao Paulo, Brazil, where he looked forward to putting his legal training to use in the visa section.

Instead, he ended up before the department's grievance board, the plaintiff in a lawsuit with potentially far-reaching consequences for determining who should be allowed to visit the United States.

Olsen alleges that he was wrongfully dismissed in 1994, after serving for two years in Sao Paulo, because he opposed State Department practices that discriminated against visa applicants "based on race, color, national origin, sex and appearance." In a 51-page complaint, he cited a manual containing "codes" that consular officers marked on visa applications, such as LP for "looks poor" and TP for "talks poor," and charged that these were used to denote "applicants rejected on account of their race or skin color."

The State Department strongly denies any racial discrimination. It says this charge is disproved by applications that Olsen himself submitted as evidence.

Nevertheless, U.S. District Judge Stanley Sporkin agreed with Olsen. In a 19-page opinion issued here in December, he said the visa policies were illegal because they used "profiles" that generalized not only about the factors Olsen cited, but about "ethnicity" and "economic class" as well.

Although the opinion does not require the State Department to change its practices, it has provided ammunition for immigration lawyers and civil rights advocates who want to empower U.S. courts to review the visa decisions made by consular officers overseas.

Lucas Guttentag, director of the immigrants' rights project of the American Civil Liberties Union, said the practices Olsen alleged "reveal the grossest kind of discrimination" and demonstrate why the actions of consular officers ought to be reviewable in U.S. courts.

Opponents of such judicial review power argue that it would throw the visa-issuing process in chaos, tie up the legal system and weaken an important pillar of national sovereignty. Last year, the State Department issued nearly 6 million nonimmigrant visas and rejected requests for 1.6 million others.

Mark Krikorian, director of the Center for Immigration Studies, said if foreigners are allowed to challenge visa denials in U.S. courts -- in effect, asserting a "right" to a visa -- then "we will have abolished in one stroke the borders of the United States, because we will no longer have the authority to decide who's allowed in and who's not allowed in."

"I see this as an extremely serious assault on the sovereignty of the United States," Krikorian said of the Sporkin ruling.

State Department officials said existing procedures for administrative review of visa denials are adequate and that recourse to courts is unwarranted.

Sporkin sent the case back to the Foreign Service Grievance Board, which had rejected Olsen's complaint. The board received briefs from both sides Friday and will issue a new decision next month. Olsen, now 53, is seeking an offer of reinstatement, back pay and $750,000 in damages.

According to the State Department, Olsen was not fired for the reasons he claimed, but because he worked too slowly and showed poor judgment by granting visas to unqualified applicants. Officials who worked with him insist that he did not complain about any discrimination until after he was told he was being dismissed.

The State Department says the abbreviations were not part of official policy, but were drawn up by junior officers in Sao Paulo and used among themselves to signal which applicants should be called in for interviews and carefully scrutinized. The consulate stopped using the codes in 1994 when the junior officers left for other assignments, the department says.

Out of nine Brazilian visa applications that Olsen cited as examples of rejections involving discrimination by race or appearance, four were actually approved after the applicants were interviewed, State Department records show. At least two of the five who were turned down listed their race as "white," and in one instance, it was Olsen who declined to issue the visa.

Diplomats acknowledge privately that consulates do discriminate, but not in the way Olsen alleges. Rather, they say, the nonimmigrant visa system inherently discriminates against applicants who are poor or come from poor countries, largely because of pervasive fraud by people who seek tourist or business visas so they can settle here illegally.

Of the some 5 million illegal immigrants permanently residing in the United States, 41 percent overstayed their visas, according to the Immigration and Naturalization Service.

Under U.S. law, consular officers must consider applicants for temporary visitor's visas as "intending immigrants" who must overcome that presumption to qualify for admission. The burden thus falls on the applicant to prove that he or she can afford the travel and does not intend to remain in the United States. Commonly requested supporting documents include income tax returns, business records and other proof of economic or family ties that bind the applicant to the homeland.

However, citizens of 26 countries can skip that process. Under the Visa Waiver Pilot Program, which gives special treatment to countries with low rates of U.S. visa refusals, they can visit the United States for up to three months with no visa. Of the 26 countries, none is considered poor and all but five are in Europe. Congress recently extended the program through April.

In Brazil, U.S. consulates grant visas to more than 90 percent of applicants, the State Department says. While overstay rates are well below those of other nationalities, the number of Brazilians who remain illegally is large enough to concern the department.

Among those turned down at the Sao Paulo consulate was Jose Eduardo Bayeux, a 24-year-old clerk who said he wanted to go to Disney World and Miami for a vacation in January 1994. On his application, a visa officer wrote "slimy looking" and "wears jacket on shoulders w/ earring."

However, the application also lists his race as "white" and includes notations about his "marginal job" and "series of marginal jobs." According to State Department officials, he was denied a visa because he could not overcome the presumption of "intending immigrant," mainly because his "vacation" plans were judged unrealistic given his salary of about $500 a month.

On the application of Elaine Cristina Machtans, a 23-year-old Brazilian office worker who described herself as "dark brown" and said she wanted to visit the United States to see World Cup soccer matches, a consular officer wrote "LP!!!!!" Although this notation was cited in Olsen's complaint and Sporkin's opinion, neither mentioned that her visa was approved after an interview. "LP" also appeared on the form of Pedro Luiz Moratori, who is white. Like Machtans, he was granted a visa after an interview.

Sporkin also criticized policies that focused on the "place of birth and national origin of applicants," referring to the consular manual's entry on "Korean/Chinese fraud."

"The singling out of applicants for additional scrutiny based upon a discriminatory profile, which is likely to increase the possibility of visa denial, is sufficiently burdensome to cause a substantial injury to these groups," Sporkin said.

In affidavits submitted to the court, Donna J. Hamilton, the deputy assistant secretary of state for visa services, and Marc Gorelick, the acting director of the State Department's Office of Fraud Prevention Programs, said visa fraud in Sao Paulo by applicants of Korean and Chinese descent is a "major problem." They said alien-smuggling rings often have tried to move Asians into the United States by first bringing them to Brazil and passing them off as members of the local Korean and Chinese communities there.

The best way to thwart the fraud, Gorelick said, is by interviewing the applicants.

Olsen, who now works for a law firm in the District, said he thought the accounts of visa fraud in Brazil were "an invention" by the State Department.

According to State Department officials, a number of the applicants Olsen approved remained illegally in the United States, including one who falsely claimed to own a clothing factory. Olsen disputes this.

A former colleague, who did not want to be identified, described Olsen as a trusting man who had trouble with the "intending immigrant" concept. "It's kind of like guilty until proven innocent," she said. "Bob couldn't deal with that. He was an attorney. He thought it was unfair." CAPTION: In a December ruling, U.S. District Judge Stanley Sporkin found the visa policies illegal because they were based on "ethnicity" and "economic class."