When Takahisa Suzuki put up the ''No Foreigners'' sign in his jewelry shop he probably had no idea he was doing anything wrong, let alone that his act would go down in history as the first case of racial discrimination to be recognized by a Japanese court.

Why should he? There is no mention of racism in Japan's civil and penal codes and little discussion of the problem. With the local papers full of stories about criminal gaijin (literally ''outside people'') it probably seemed a reasonable precaution.Suzuki felt so sure his actions were justified that he called the police when a young Brazilian woman refused to leave.

But Japan got a wake-up call on human rights when Ana Bortz, a journalist, launched a legal action to demand compensation for her treatment.

To the surprise of everyone, including her own lawyer, she won. The Shizuoka district court ruled recently that Suzuki's action violated the U.N. convention on the elimination of all forms of racial discrimination, which Japan signed in 1996. It awarded $47,000 in damages.

The decision is expected to generate a flood of similar claims and raise awareness about racial prejudice in a country that cherishes its ethnic homogeneity.

''For the first time in Japan, this judgment shows very clearly that discrimination is illegal,'' said Hideyo Ogawa, Bortz's lawyer. ''It made me realize that Japanese people don't think about this problem at all.''

Nowhere is that more evident than in Hamamatsu city, home to Suzuki and a Brazilian community that has grown from a couple of hundred to 10,000 in 10 years.

The Brazilians have been blamed for rising crime in the area and it is not uncommon to hear public address warnings in shops stating: ''Mind your belongings. There are foreigners around.'' Right-wing groups have paraded around Brazilian neighborhoods, shouting ''Foreigners go home.''

Apologists argue that Japan is simply not used to gaijin. Until 1853, the country spent centuries in isolation, and, even now, foreign residents make up only 1.2 percent of the population.

This feeling of discomfort, made worse by language problems, has been used to explain why many landlords refuse to rent to gaijin; why a handful of bath houses and bars ban non-Japanese; and why some train passengers stand rather than take an empty seat next to a foreigner.

It is a small minority that carry out these acts of discrimination. The problem, say foreigners, is that the majority usually turn a blind eye.

The worst racism is suffered by the large Korean community, which is campaigning for citizenship and voting rights for families that have lived in Japan for decades.

Last year, the United Nations human rights commission called on Japan to halt its alien-registration system, which forces foreigners to notify the authorities of any change of address and to carry an identification card at all times or face a penalty of up to $810.

There are signs that change may be on the way. Senior politicians and diplomats are starting to recognize that Japan's ethnic purity threatens to hold back the country's international ambitions.

Sadako Ogata, the U.N. high commissioner for refugees, recently lamented that Japan took in only one refugee in the whole of 1996 and 1997. ''We live under the illusion of one ethnic race, one culture. A mono-ethnic island of prosperity won't survive in the 21st century.''