Japan–Malaysia relations refers to bilateral foreign relations between the two countries, Japan and Malaysia. The earliest recorded historical relation between the two nations are the trade relations between the Malacca Sultanate and the Ryūkyū Kingdom in the 15th century. Small numbers of Japanese settlers migrated to various parts of present-day Malaysia throughout the 19th century. This continued well into the 20th century, until relations reached an abrupt nadir with the rise of the Empire of Japan and its subsequent invasion and occupation of British Malaya and Borneo during World War II, during which the local populace endured often brutal Japanese military rule.