Fujian came under Imperial Chinese domination in the Qin (Ch’in) dynasty (221-206 bc), but was not effectively annexed before the 7th century ad. Its overseas trade prospered from the 12th to the 17th century and then declined with the rise of the port of Guangzhou (Canton) to the west. Fuzhou and Xiamen, opened to foreign trade in 1842, were important as tea ports in the 19th century. The presence of Nationalist forces on the strategic offshore islands of Matsu and Chinmen (Quemoy) since 1949 has adversely affected coastal shipping. The construction of railroads to neighboring provinces since the 1950s has alleviated the region's physical isolation.
.

.
When compared to the history of China as a whole, which dated all the way back to 2,000 BC, Xiamen is relatively young. First records of its existence manifested during the Song dynasty (960-1279) when it was an isolated subsistence farming community of 4,000 residents. Its first entry into national significance occurred in the late 1300s, when the ruling Ming dynasty took advantage of Xiamen's coastal location and natural harbor to transform the city into a frontline against the advances of invading pirates and restless Japanese expansionists.
Quanzhou is the oldest port in Fujian, and was at its peak during the Tang dynasty (618-907). Its fortunes declined after the Ming dynasty (1368-1644) but later Fujian’s treaty ports of Fuzhou and Xiamen (Amoy) thrived. Today, the provincial capital of Fuzhou and the picturesque seaside city of Xiamen are experiencing the most economic success in the province.
.

.
In 1387, the Ming Dynasty used it as base against pirates, and was part of Quanzhou. Koxinga stationed here in 1650, naming it Siming Island, or "Remembering the Ming", but the city was renamed by the Manchus in 1680 to Xiamen Subprefecture. The name "Siming" was reverted after the 1912 Xinhai Revolution and made a county. The following it was reverted to Xiamen City. In 1949, Xiamen became a provincial city, then upgraded to a municipality. It was made a Special Economic Zone in 1980.
.

.
Xiamen was the port of trade first used by Europeans in 1541. It was China's main port in the 19th century for exporting tea. As a result, the Amoy dialect had a major influence on how Chinese terminology was translated into English and other European languages. For example, the words "Amoy", "tea" (茶; tê), "cumshaw" (感谢; kám-siā), "ketchup" (茄汁; kiô-chiap), and "Pekoe" (白毫; pe?h-hô) originated from the Amoy dialect.