Liuqiu/Ryūkyū 琉球, also written 琉求, 流求, 留求, or 瑠求, was an ancient designation for the island of Taiwan. During the Three Kingdoms 三國 (220~280 CE) and Southern Dynasties period 南朝 (420-589), the island was known as Yizhou 夷洲 "Island of Barbarians", a name which was changed to Liuqiu under the Sui dynasty 隋 (581-618). The Ming 明 (1368-1644) used to called it Xiao Liuqiu 小琉球 (while the 明代称今台湾岛为小琉球，别于大琉球（今琉球群岛），清初仍有人用此名。), but the designations Beixiang 北港 "Northern Port", Jilong 雞籠 (i.e. Keelung, today written 基隆) and Dongfan 東番 "Eastern Barbarians" were also known. The name Taiwan was first used around 1600. There is common agreement that the name Liuqiu did before 1600 not refer to Okinawa 沖繩 or the Ryūkyū Islands. Since the archipelago is part of Japanese territory since more than 150 years (with interruptions after WW II), the islands are also called Ryūkyū in a historical perspective, at least from the Western side, while in Chinese texts, the name is of course read "Liuqiu".
The Sui dynasty tried in 607 and 608 to conquer Liuqiu (Taiwan). In 610, the generals Chen Ling 陳稜 (d. 619) and Zhang Zhenzhou 張鎮周 commanded a fleet of more than 10,000 troops which started from the port of Yi'an 義安 (present-day Chao'an 潮安, Guangdong). It took the fleet more than one month to reach the soil of Liuqiu. The local king Ke-ci-dou 渴剌兜 was defeated and withdrew to stockaded fortresses in the jungle. The well-equipped Sui army took the fortress, killed the king, took captives, and returned.
Contacts during the Tang 唐 (618-907) and Song 宋 (960-1279) periods were scarce, but it is known that the inhabitants of Liuqiu (Taiwan) traded with the tribes on the northern islands of the Philippines.
An attempt of Qubilai Qan (r. 1260-1294), founder of the Yuan dynasty 元 (1279-1368), to force Liuqiu to send tributes failed. Early Ming period chronicles report that the country had three kings, all hailing from the Shang 尚 lineage, and ruling over three parts of the land, namely Zhongshan/Chūzan 中山, Shannan 山南 (Nanzan 南山), and Shanbei 山北 (Hokusan 山北). The first diplomat from the kingdom of Zhongshan, Prince Taiqi 泰期, was invited by the official merchant Yang Dai 楊載, and visited the imperial capital in 1372. Two years later, the Prince again came to Nanjing 南京 (today in Jiangsu), this time reveived by the Vice Minister of Justice, Li Hao 李浩, and traded patterned silks (wenqi 文綺), pottery and iron tools against horses. From then on, the exchange of merchandise against horses and sulphur took regular shape.
In 1378, the king of Shannan joined the tribute exchanges between Liuqiu and Ming China, and sometimes sent envoys together with the kingdom of Zhongshan. In 1383, the Ming court bestowed the two kings official gold-and-silver gilt seals (du jinyin yin 鍍金銀印). The influence of the Ming on the internal politics of Liuqiu made itself visible when the two kings were ordered to make peace with King Pani 怕尼 of Shanbei. From 1384 on, the three kings delivered unified tribute missions to the Ming. In 1390, the interpreter tried to smuggle frankincense (ruxiang 乳香) and pepepr (hujiao 胡椒), but was caught and reprimanded.
The most important tributes brought to China by Liuqiu were gold, Japanese fans, agilawood (shenxiang 沉香), agate manao 瑪瑙, ebony (wumu 烏木), Dalbergia odorifera (jiangxiang 降香), costus root (muxiang 木香), ivory (xiangya 象牙), XXX (xisuxiang 錫速香), cloves (dingxiang 丁香), sandalwood (tanxiang 檀香), or XXX (huangshuxiang 黃熟香), and many more commodities, most of which did acutally not originate in Liuqiu, but in Indonesia or even India. The Ming court in turn handed the "Liuqiuans" over ships, but for some time, also silken cloth for winter and summer.
In a larger mission of 1325, the king of Zhongshan asked to be allowed to send young men to the National University (guoxue 國學) in China, and the sons and daughters of some tribal leaders (zhaiguan zhi 寨官子, nüguan 女官) or of ministers (peichen 陪臣) were sent to attend.
In 1405, Shanbei was swallowed by the two other kingdoms, but tribute envoys visited China annually, and even up to two, or three times a year. In 1429, Zhongshan conquered also the kingdom of Shannan.
The kings of Zhongshan were formally invested by the Ming emperors, each time of a succession. There were some instances when envoys robbed and killed Chinese citizens on their way back through Fujian. Such an incident in 1474 caused the emperor to restrict the size of envoy communities to 100 persons, and prohibited private trade. A years-long dispute arose, in which the emperor did not concede Liuyiu formal rights as Chosŏn or Vietnam. Only in 1482, the original, tribute mission every second year was reintroduced, but only 25 persons were allowed to come to Nanjing (not Beijing). In the following years, the Liuqiu diplomats complained because of these harsh conditions, and that their people had been tricked by Chinese merchants.
Liuqiu was also affected the so-called "dwarf pirates" (wokou 倭寇, assumed to be Japanese), but in 1557 a Ming fleet was able to repel a pirate fleet and even liberated Chinese captives. From time to time, Liuqiu envoys also brought Chinese sailors back which had been thrown ashore by a typhoon. The biennial tribute missions were reduced to ten-year frequency. In the late Ming period, the frequency was intensified to tribute missions every five years.
During the Wanli reign 萬曆 (1573-1620), the Ming court began to interprete Liuqiu as a stronghold against Japanese which had just conquered some of the islands in the north. Smaller Chinese fleets used Liuqiu to fight against pirates. In 1612, Japan invaded Liuqiu with 3000 men and captured and detained the king for some time. Four years later, Japanese troops conquered the port of Jilong and renamed it Taiwan.
The last tributes of Liuqiu to the Ming were delivered to the Prince of Tang 唐王 (r. 1645-1646), who resided in Fujian province. In 1646, the first Liuqiu envoy was received at the Qing 清 (1644-1911) court, but no formal investiture of the king was carried out until 1654.
In 1684, Liuqiuans enrolled for the first time at the Directorate of Education (guozijian 國子監) of the National University of the Qing, and in 1716, Liuqiu built a an own government school (fuxue 府學, the term actually denotes prefectural schools).
Merchants from Liuqiu were freed from import taxes (guanshui 關稅), but traded mostly with Japan, and therefore also used Japanese coins. Also, the kings of Liuqiu delivered tributes to Japan, and were culturally and economically more and more dependent from its northern neighbour.
The islands were for the first time endangered by colonialism in 1864, when Japan as well as Great Britain harboured contending troops in Liuqiu. In 1872, Liuqiuans killed four Japanese sailors from the prefecture of Oda 小田. This was a pretext for the occupation of the islands and of Taiwan. In 1879, Japan conquered Liuqiu and ended the kingdom, transforming it into the prefecture of Okinawa 沖繩縣.
The king and his son were detained in Japan. There were disputes with China, and Japan suggested to cede the southern part of the archipelago to China, but the Qing court did not respond to this idea because it saw not advantage in the barren islands, neither for China nor for the former king. The survival of the royal dynasty of Liuqiu was more important for Qing China.
There is nearly a dozen of traditional Chinese books on Liuqiu, beginning with Chen Kan's 陳侃 (1507-?) Shi Liuqiu lu 使琉球錄 (also called Liuqi shilüe 琉球使略, Guo Shilin's 郭世霖 Shi Liuqiu lu 使琉球錄, Shi Liuqiu lu 使琉球錄 by Xiao Chongye 蕭崇業 (d. 1588) and Xie Jie 謝傑 (1536-1604), Sun Tingquan's 孫廷銓 (1613-1674) Liuqiuzhi 琉璃誌 and Wang Shizhen's 王士禎 (1634-1711) Liuqiu ru taixue shimo 琉球入太學始末, to Zhou Huang's 周煌 (d. 1785) Liuqiu guo zhilüe 琉球國志略, Zhao Xin's 趙新 Xu Liuqiu guo zhilüe 續琉球國志珞, Pan Xiang's 潘相 (jinshi degree 1763) Liuqiu ruxue jianwen lu 琉球入學見聞錄, Li Dingyuan's 李鼎元 (1750 1805) Shi Liuqiu ji 使琉球記 and Master Qian's 錢 Liuqiu shilu 琉球實錄 to the source book Qingdai Liuqiu jilu jiji 清代琉球紀錄集輯 by Zhang Xueli 張學禮, and its supplement Qingdai Liuqiu jilu xuji 清代琉球紀錄續輯 by Yao Wendong 姚文棟 (1853-1929), and Wang Tao's 王韜 (1828-1897) critical books Liuqiu chaogong kao 琉球朝貢考 and Liuqiu xianggui Riben bian 琉球向歸日本辨.