In a case that could affect Japan's relations with both China and Taiwan, the Supreme Court on Tuesday abruptly overturned a two-decade-old lower court ruling that recognized Taipei, not Beijing, as the owner of a Kyoto student dormitory.

In its ruling, the top court said China assumed the plaintiff role over Taiwan when Japan switched its diplomatic recognition to Beijing from Taipei in 1972, even though the structure was purchased by the Taipei government.

The top court's five-justice third petty bench, led by Justice Tokiyasu Fujita, overthrew the 1987 Osaka High Court decision favoring Taiwan and sent the 40-year-old suit back to the Kyoto District Court for re-examination, court officials said.