The People's Republic of China (PRC) and Malaysia established diplomatic relations in May 1974. The PRC has its embassy in Kuala Lumpur, and consulate-general offices in George Town, Kota Kinabalu, Kuching and Singapore. Malaysia maintains its embassy in Beijing, as well as consulate offices in Kunming, Guangzhou, Shanghai, Xi'an and Hong Kong. The two countries are also bounded by the historical presence of Chinese people in Malaysia, which is currently the second largest Chinese diaspora around the world. Both countries are claimants in the South China Sea dispute and in recent times has resulted in friction.

History Early contact Kunlun or Malay sailors were known in China by the third century BC, and there is evidence that had begun to settle along East African coast by the first century CE. By the time of Roman Empire, there were permanent communities of Malayo-Polynesian speaking people on the coast of Malagasy, where they remain to this day.

Chinese records from the fifth and sixth centuries AD note that products were shipped in kunlun vessels, apparently referring to maritime Southeast Asia vessels. By the seventh century, the term kunlun refer specifically to coastal people of the Malay region. By the ninth century, in Yiqiejing yingyi (815), Hui-Lin note that kunlun bo (Malay ship) were arriving regularly at Gulf of Tonkin and along south eastern Chinese coast. As religion was quite a thing in China, kunlun was needed to refer specifically to coastal people of the Malay region, as trade grew between both countries, stuff started happening.

Chinese dynasties relations with Malay Archipelago sultanates Ming alliance with Malacca Sultanate

The Sultanate of Malacca voluntarily established political and economic ties with Ming dynasty China, which protected Malacca against its enemies with military force, allowing the Muslim Sultanate to prosper. The Ming dynasty had played role in Malacca's external affair with Siam and Majapahit from conquering Malacca. At the foundation of Malacca, the native peoples were the peoples with Hinduism and Buddhism influence. According to the annals record, at the time Parameswara founded Malacca, the country had been few times attacked by the empire of Majapahit and the rivals from northern area of Malacca, Ayutthaya Kingdom. Being a strategist at that time, the ruler of Malacca decided to send his ambassadors to visit the Emperor of China, one of the superpower of the period, the Emperor of the Ming dynasty, and both agreed to become allies. Ever since the agreement between Malacca Empire and Ming Empire, the Ayutthaya Kingdom and Majapahit Empire never intended to attack Malacca. Later some records suggested that during the trade activities and arrival of the Chinese-Muslim admiral Zheng He, Islam has already rooted in the Malay people at that time. Parameswara himself had converted to Islam earlier and adopted an Islamic name, Sultan Iskandar Shah. The new religion spread quickly throughout his conversion and due to the busy tradings and cultural exchanges with Arabs and Indians who were themselves Moslem.

Ming dynasty China warned Siam and the Majapahit against trying to conquer and attack the Malacca sultanate, placing the Malacca Sultanate under Chinese protection as a protectorate, and recognized the sovereignty of the ruler of Malacca. The Chinese strengthened several warehouses in Malacca. The Muslim Sultanate flourished due to the Chinese protection against the Thai and other powers who wanted to attack Malacca, while keeping strategic political ties with other Muslim countries at that time. Siam was also a tributary to China and had to obey China's orders not to attack. After Vietnam (Annam) destroyed Champa in the 1471 Vietnamese invasion of Champa, they proceeded to engage in hostilities with Malacca with the intent of conquest. The Chinese government sent a censor, Ch'en Chun, to Champa in 1474 to install the Champa King, but he discovered Vietnamese (Annamese) soldiers had taken over Champa and were blocking his entry. He proceeded to Malacca instead and its ruler sent back tribute to China. Malacca again sent envoys to China in 1481 to inform the Chinese that, while Malaccan envoys were returning to Malacca from China in 1469, the Vietnamese attacked the Malaccans, killing some of them while castrating the young and enslaving them. The Malaccans reported that Vietnam was in control of Champa and also sought to conquer Malacca, but the Malaccans were holding tight and wait for the diplomatic signal because they did not want to fight against another state that was a tributary to China without permission from the Chinese. They requested to confront the Vietnamese delegation to China which was in China at the time, but the Chinese informed them since the incident was years old, they could do nothing about it, and the Emperor sent a letter to the Vietnamese ruler reproaching him for the incident. The Chinese Emperor also ordered the Malaccans to raise soldiers and fight back with violent force if the Vietnamese attacked them again.

After the Portuguese invaded and destroyed the Malacca sultanate at the Capture of Malacca (1511), it established the Portuguese Malacca colony. The Chinese reacted with extreme anger at the Portuguese invasion of its ally and refused to accept a Portuguese embassy after the attack. The Chinese Imperial Government imprisoned and executed multiple Portuguese envoys after torturing them in Guangzhou. The Malaccans had informed the Chinese of the Portuguese seizure of Malacca, to which the Chinese responded with hostility toward the Portuguese. The Malaccans told the Chinese of the deception the Portuguese used, disguising plans for conquering territory as mere trading activities, and told of all the atrocities committed by the Portuguese. Due to the Malaccan Sultan lodging a complaint against the Portuguese invasion to the Chinese Emperor, the Portuguese were greeted with hostility from the Chinese when they arrived in China. The Sultan's complaint caused "a great deal of trouble" to Portuguese in China. The Chinese were very "unwelcoming" to the Portuguese. The Malaccan Sultan, based in Bintan after fleeing Malacca, sent a message to the Chinese, which combined with Portuguese banditry and violent activity in China, led the Chinese authorities to execute 23 Portuguese and torture the rest of them in jails. After the Portuguese set up posts for trading in China and committed piratical activities and raids in China, the Chinese responded with the complete extermination of the Portuguese in Ningbo and Quanzhou.

The Chinese had sent a message to the deposed Sultan (King) of Malacca concerning the fate of the Portuguese embassy, which the Chinese held prisoner. When they received his reply, the Chinese officials then proceeded to execute the Portuguese embassy, slicing their bodies into multiple pieces. Chinese traders boycotted Malacca after it fell under Portuguese control, some Chinese in Java assisted in Muslim attempts to reconquer the city from Portugal using ships. The Java Chinese participation in retaking Malacca was recorded in "The Malay Annals of Semarang and Cerbon". trading the Chinese did business with Malays and Javanese instead of the Portuguese. However, with gradual improvement of relations and aid given against the Wokou pirates along China's shores, by 1557 Ming China finally agreed to allow the Portuguese to settle at Macau in a new Portuguese trade colony.Wills, John E., Jr. (1998). "Relations with Maritime Europe, 1514–1662," in The Cambridge History of China: Volume 8, The Ming Dynasty, 1368–1644, Part 2, 333–375. Edited by Denis Twitchett, John King Fairbank, and Albert Feuerwerker. New York: Cambridge University Press. , 343–344. The Malay Sultanate of Johor also improved relations with the Portuguese and fought alongside them against the Aceh Sultanate.

Relations with Bornean Sultanate

As China had been under the conquest of Mongol Empire, all Chinese vassal state subsequently controlled by the Mongol emperors of China. Early in 1292, Kublai Khan is said to have sending an expedition to northern Borneo, before departing for the invasion of Java in 1293. As a result of this campaign, it is believed that many of his followers in addition to other Chinese traders eventually settled and established their own colony at Kinabatangan River. In the 14th century, Brunei became the vassal state of Majapahit but in 1370 transferred its allegiance to Ming dynasty of China. The Maharaja Karna of Borneo then paid a visit to Nanjing with his family until his death. He was succeeded by his son Hsia-wang who agreed to send tribute to China once every three years. Since then, Chinese junks came to northern Borneo with cargoes of spices, bird nests, shark fins, camphor, rattan and pearls. More Chinese traders eventually settled in Kinabatangan, as stated in both Brunei and Sulu records. A younger sister of Ong Sum Ping (Huang Senping), the Governor of the Chinese settlement then married Sultan Ahmad of Brunei. Perhaps due to this relationship, a burial place with 2,000 wooden coffins, some estimated to be 1,000 years old, were discovered in Agop Batu Tulug Caves in the Kinabatangan area. It is believed that this type of funeral culture was brought by traders from mainland China and Indochina to northern Borneo as similar wooden coffins were also discovered in these countries. In addition with the discovery of Chinese ceramics from a shipwreck in Tanjung Simpang Mengayau which estimated to be from 960 to 1127 A.D. of Song dynasty and Vietnamese Đông Sơn drum in Bukit Timbang Dayang on Banggi Island that had existed between 2,000 and 2,500 years ago.

Peranakan Chinese In old times the first group of Chinese people in Malaysia used to be held in high regard by Malays. Some old Malays in the past may have taken the word "Baba", referring to Chinese males, and put it into their name, when this used to be the case.

British colonialism

The British involvement in Malay politics began in the 18th century with the establishment of trading posts in Penang (formerly part of Kedah) and were interested in the tin resources of the Malay Peninsula and sought to protect their trading interests in the region, by treaties and agreements with local rulers, the British gradually expanded their influence and control over various Malay states. These were significantly influenced by trade and the strategic importance of these locations for British commercial interests. While Sir Stamford Raffles's establishment of a British trading post in Singapore in 1819 was a key event, the colonization of these areas was a broader process driven by various factors beyond just Raffles's actions. The British also had a hand in influencing Malay politics, establishing trading posts, and ultimately gaining control of the island of Singapore with the founding of modern Singapore by the formal treaty of British East India Company, Singapore was developed as a thriving colony and port, eventually becoming the seat of government for the Straits Settlements as the British had bought Indians and Chinese workers to Singapore, along with existing Malay populations and other traders once were among the earliest inhabitants, and many participated in fishing, craftsmanship, or wage labor, where they support the colony's growing economy by developing the island's infrastructure and plantations. In 1841, while the British are at war with the Qing Empire at the First Opium War, the Second Battle of Chuenpi became a major victory for the British Empire as Charles Elliot declared the cession of Hong Kong to the United Kingdom, with Henry Pottinger became the first Governor of Hong Kong in 1843. The Battle of Singapore became a major British defeat when it fell to the Japanese occupation in February 1942 during World War II which went on until it was liberated on 12 September 1945.

Cold War era