For centuries, Japan was within the cultural sphere of the vast Chinese civilisation to its west. It adopted the Chinese writing system and numerous other cultural legacies.
Modern tensions in China's relations with Japan date back to the 1894-5 Sino-Japanese war, in which Japan marked its emergence as a world power by inflicting a shock defeat on China.
The massacre in Nanjing in the late 1930s soured relations for decades
Japan won Formosa (now Taiwan) and by 1910 it had also colonised the Korean peninsula.
Japan's militarisation accelerated in the early 1930s, and the resource-poor country set its sights on more imperial prizes.
In 1931 Japan invaded north-eastern China. Japan then sought to consolidate its hold on China and in 1937 it swept south.
The fall of the Chinese city of Nanjing heralded one of the most poisonous episodes in Sino-Japanese relations.
Japanese soldiers embarked on a frenzy of murder, rape and looting in which estimates suggest up to 300,000 people were killed and 20,000 women were raped.
Chinese women were also among the tens of thousands of Asian women forced to serve as sexual slaves to Japanese soldiers.
Japan's government also sponsored the development of chemical and biological weapons in China, testing them against POWs and civilian populations.
Armed resistance to Japanese control in China continued throughout World War II. Finally defeated, the retreating Japanese forces are thought to have left at least 700,000 chemical weapons littering China.
Japan and the People's Republic of China finally normalised relations in 1972.