The Supreme Court ruled Thursday it is illegal for authorities to bar all foreigners without valid residency status from the national health insurance program.

It is the first time the top court recognized the right of overstaying foreigners to join the health insurance system, as far as they are likely to maintain a stable living in Japan.

The court ruled that it was illegal to deny Li Hsueh-shan, 51, who has lived in Japan since 1971, the right to join the insurance scheme.