A HUNDRED years ago, Japan was, to many Chinese intellectuals, a source of inspiration, a place of educational opportunities and a political refuge.
In the current climate of Sino-Japanese relations, that is easy to forget.
Japan's victory in the Sino-Japanese war of 1894-5 emphasised to many Chinese how their country's failure to modernise had weakened its ability to defend itself. China had been defeated and bullied by Western powers since the Opium Wars, but this was the first case in modern times that it had suffered defeat at the hands of another Asian country, long assumed to be no match for China.
The lesson drawn by many was that China needed to learn from how Japan had built itself into a powerful country. Within the Qing Court, there were modernisers who saw a need for administrative reform and a re-equipped, re-trained armed forces.
And they continued to hold this view even after the imperial army, then in the process of modernisation, was defeated by better trained foreign troops during the Boxer Rebellion of 1899-1901.
Elsewhere, there were those, such as Sun Yat Sen, who concluded that the Qing dynasty and the imperial institutions that upheld its rule were a fundamental obstacle to China's modernisation. But while reformers and revolutionaries alike resented Japan's defeat of their country, they could respect Japan's economic and social achievements.
Attitudes towards Japan became much less ambivalent as a result of the Russo-Japanese War of 1904-05. It was largely fought on Chinese territory, in Manchuria, and Chinese civilians were inevitably killed and maimed during the conflict. Chinese property was one of the prizes at stake in the war: Japan aimed to wrest Port Arthur (Dalian) from Russia, as well as assert its interests in the resources of Manchuria.
Yet what mattered to most patriotic Chinese at the time was that an Asian country had defeated a European power. They could therefore overlook China's own losses in the war, as well as the defeat of 1895.
Japan admitted a stream of Chinese students to its universities at this time. One of them was Lu Xun, later to become well-known as a writer. In 1902, he was given a government scholarship to study in Japan. He learnt Japanese, and much of his early acquaintance with European literature was made through books translated into Japanese.
He returned to China after eight years in Japan.
Years later, in 1926, he recalled with affection Mr Fujino, who taught anatomy in the medical college at Sendai. Lu Xun was the only Chinese student at the college. Mr Fujino asked to see Lu Xun's notes of his lectures, and then patiently corrected them, which helped ensure that he passed the annual examination.
Lu Xun described him as, of all his teachers, "the one to whom I feel most grateful and who gave me the most encouragement". He thought that Mr Fujino wanted China to have modern medical knowledge.
Chen Duxiu and Li Dazhao, founders of the Communist Party of China, both studied in Japan. Chen was there from 1900 to 1902, at Tokyo Normal School and then at Waseda University. This was where he first became involved in politics, joining the Chinese Youth Society, a group founded by one of Sun Yat Sen's associates.
Chen returned to Japan briefly in 1906 and then again from 1913 to 1915, following the dissolution of China's first Parliament by the ambitious former Qing general, Yuan Shih-kai.
Li studied political economy at Waseda University from 1913 to 1916 before returning to China.
Zhou Enlai also studied in Japan, though only for 18 months. He arrived in 1917 and went to classes at Waseda University, in Tokyo, and at Kyoto University. In 1936, he told American journalist Edgar Snow that he had met other "revolution-minded" Chinese students while there.
Another Chinese who studied in Japan taught Mao Zedong. Interviewed by Edgar Snow in his book, Red Star Over China, Mao recalled going to a new school when he was 16 years old. One of the teachers there was derided as the "False Foreign Devil" by students, who could see that his queue was false. He had studied in Japan, and Mao liked to hear him talk about what the country was like.
The teacher taught English and music. One of his songs was called The Battle Of The Yellow Sea. It celebrated Japan's victory over Russia in 1905, and made such an impression on Mao that he could still remember part of it in 1936, when he spoke to Snow.
Mao said: "At that time I knew and felt the beauty of Japan, and felt something of her pride and might, in this song of her victory over Russia. I did not think there was also a barbarous Japan - the Japan we know today".
Among the Chinese who went to Japan in the early 20th century were political dissidents who did not arrive, first of all, as students. The best known was Sun Yat Sen, who lived there for much of the period between the First Guangzhou Uprising in 1895 and the 1911 Revolution.
It was in Tokyo that the Tongmenghui (United League), forerunner of the Kuomintang, was formed, though it soon relocated its headquarters to Singapore.
If Chinese reformers and revolutionaries had a positive impression of Japan in the early years of the 20th century, it changed fairly quickly during World War I.
Japan's leaders agreed that their country needed guaranteed access to Chinese resources.
But they disagreed over the best way to secure it - whether through cooperation with a Chinese government, albeit on terms favourable to Japan, or through more direct control. The issue was settled by World War I, when the European powers that had previously checked Japan's ambitions in China were thoroughly preoccupied with fighting each other.
As an ally of Britain, Japan occupied the German base of Tsingtao (Qingdao) in 1914 and sought to retain it, as well as German economic interests in Shandong province.
In December 1914, Japan's ambassador to China presented Yuan Shih-kai's government with the Twenty-One Demands, which called for extensive economic concessions to Japan, including rights over a number of railways.
The government felt forced to agree to most of the demands, but the episode reflected badly on both Japan and Yuan Shih-kai in the eyes of patriotic Chinese. When Japan tried to solidify its gains in China at the Versailles Peace Conference in 1919, it provoked the May Fourth Movement. Sino-Japanese relations went from bad to worse, reaching their nadir with the war of 1937-45.
Today, it is all too easy for nationalists in China and Japan to incite hostility between their peoples and portray their modern histories in terms of unending conflict. That interpretation, however, is simply untrue.
The two nations grated against each other, and fought, as neighbours often do.
But there were also episodes when state-to-state relations were better, and, even more, when there were ties of friendship, respect and cooperation between citizens of the two countries.
The writer is a freelance journalist who writes regularly on Asian affairs.
Get a copy of The Straits Times or go to straitstimes.com for more stories.