Japan has a rich cultural tradition dating back to prehistory. As an island nation it was isolated from outside attack through much of its history and alternated between periods of extensive contact with its neighbors and relative aloofness. However, it usually had some form of contact with China, and over time Japan adapted Chinese administrative practices, Buddhism, music, architecture, and arts.
In the 1st century C.E. Japan's ruler sent envoys to the court of the ruler of the Chinese Han dynasty; after this visit China and Japan established trade relations, but they were not particularly strong. Later Buddhism was introduced from China to Japan (having come to China from India in the 1st century C.E.). However, the period of greatest Chinese influence in Japan was the 7th through 10th centuries. Buddhism became the official religion, and Buddhist priests traveling from China introduced Chinese literature and art traditions, as well as mathematical concepts and new medical knowledge. They even helped the Japanese draw up irrigation plans. The Japanese emperors adopted the chessboard grid plan of the Chinese capital of Chang'an when they built Nara and Heian-kyo (today Kyoto), their two capital cities of this period.