Incorporated into the Han Dynasty, Panyu became a provincial capital.
In AD 226, it became the seat of Guang Prefecture, which gave it its modern name.
The Old Book of Tang described Guangzhou as an important port in southern China.
Direct routes connected the Middle East and China, as shown in records of a Chinese prisoner returning home from Iraq twelve years after his capture at Talas.
Relations were not always peaceful: Arab and Persian pirates sacked the city on 30 October 758 and were massacred by the Chinese rebel Huang Chao in 878, along with the city's Jews, Christians, and Parsis.
The port was reportedly closed for fifty years after the chaos.

Amid the Five Dynasties and Ten Kingdoms that followed the collapse of the Tang dynasty, the Later Liang governor Liu Yan used his base at Panyu to establish a "Great Yue" or "Southern Han" empire, which lasted from 917 to 971.
The region enjoyed considerable cultural and economic success in this period.
From the 10th to 12th century, there are records that the large foreign communities were not exclusively male, but included "Persian women".
According to Odoric of Pordenone, Guangzhou was as large as three Venices and rivalled all of Italy in the amount of crafts it produced.
He also noted the large amount of ginger available as well as large geese and snakes.
Guangzhou was visited by the Moroccan traveler Ibn Battuta during his 14th-century journey around the world; he detailed the process by which the Chinese constructed their large ships in the port's shipyards.

Shortly after the Hongwu Emperor's declaration of the Ming dynasty, he reversed his earlier support of foreign trade and imposed the first of a series of sea bans (haijin).
These banned private foreign trade upon penalty of death for the merchant and exile for his family and neighbors.
The Yuan-era maritime intendancies of Guangzhou, Quanzhou, and Ningbo were closed in 1384 and legal trade became limited to the tribute delegations sent to or by official representatives of foreign governments.

Following the Portuguese conquest of Malacca, Rafael Perestrello travelled to Guangzhou as a passenger on a native junk in 1516.
His report induced Fernão Pires de Andrade to sail to the city with eight ships the next year, but De Andrade's exploration was understood as spying and his brother Simão and others began attempting to monopolize trade, enslaving Chinese women and children, engaging in piracy, and fortifying the island of Tamão.
Rumors even circulated that Portuguese were eating the children.
The Guangzhou administration was charged with driving them off: they bested the Portuguese at the Battle of Tunmen and in Xicao Bay; held a diplomatic mission hostage in a failed attempt to pressure the restoration of the sultan of Malacca, who had been accounted a Ming vassal; and, after placing them in cangues and keeping them for most of a year, ultimately executed 23 by lingchi.
With the help of local pirates, the "Folangji" then carried out smuggling at Macao, Lampacau, and St John's Island (now Shangchuan), until Leonel de Sousa legalized their trade with bribes to Admiral Wang Bo (汪柏) and the 1554 Luso-Chinese Accord.
The Portuguese undertook not to raise fortifications and to pay customs dues; three years later, after providing the Chinese with assistance suppressing their former pirate allies, the Portuguese were permitted to warehouse their goods at Macau instead of Guangzhou itself.

In October 1646, the Longwu Emperor's brother Zhu Yuyue fled by sea to Guangzhou the last seat of the Ming empire.
On 11 December, he declared himself the Shaowu Emperor, borrowing his imperial regalia from local theatre troupes.
He led a successful offense against his cousin Zhu Youlang but was deposed and executed on 20 January 1647 when the Ming turncoat Li Chengdong (李成東) sacked the city on behalf of the Qing.

The Qing became somewhat more open to foreign trade after gaining control of Taiwan in 1683.
The Portuguese from Macau and Spaniards from Manila returned, as did private Muslim, Armenian, and English traders.
From 1699 to 17
Incorporated into the Han Dynasty, Panyu became a provincial capital. In AD 226, it became the seat of Guang Prefecture, which gave it its modern name. The Old Book of Tang described Guangzhou as an important port in southern China. Direct routes connected the Middle East and China, as shown in records of a Chinese prisoner returning home from Iraq twelve years after his capture at Talas. Relations were not always peaceful: Arab and Persian pirates sacked the city on 30 October 758 and were massacred by the Chinese rebel Huang Chao in 878, along with the city's Jews, Christians, and Parsis. The port was reportedly closed for fifty years after the chaos.
Amid the Five Dynasties and Ten Kingdoms that followed the collapse of the Tang dynasty, the Later Liang governor Liu Yan used his base at Panyu to establish a "Great Yue" or "Southern Han" empire, which lasted from 917 to 971. The region enjoyed considerable cultural and economic success in this period. From the 10th to 12th century, there are records that the large foreign communities were not exclusively male, but included "Persian women". According to Odoric of Pordenone, Guangzhou was as large as three Venices and rivalled all of Italy in the amount of crafts it produced. He also noted the large amount of ginger available as well as large geese and snakes. Guangzhou was visited by the Moroccan traveler Ibn Battuta during his 14th-century journey around the world; he detailed the process by which the Chinese constructed their large ships in the port's shipyards.
Shortly after the Hongwu Emperor's declaration of the Ming dynasty, he reversed his earlier support of foreign trade and imposed the first of a series of sea bans (haijin). These banned private foreign trade upon penalty of death for the merchant and exile for his family and neighbors. The Yuan-era maritime intendancies of Guangzhou, Quanzhou, and Ningbo were closed in 1384 and legal trade became limited to the tribute delegations sent to or by official representatives of foreign governments.
Following the Portuguese conquest of Malacca, Rafael Perestrello travelled to Guangzhou as a passenger on a native junk in 1516. His report induced Fernão Pires de Andrade to sail to the city with eight ships the next year, but De Andrade's exploration was understood as spying and his brother Simão and others began attempting to monopolize trade, enslaving Chinese women and children, engaging in piracy, and fortifying the island of Tamão. Rumors even circulated that Portuguese were eating the children. The Guangzhou administration was charged with driving them off: they bested the Portuguese at the Battle of Tunmen and in Xicao Bay; held a diplomatic mission hostage in a failed attempt to pressure the restoration of the sultan of Malacca, who had been accounted a Ming vassal; and, after placing them in cangues and keeping them for most of a year, ultimately executed 23 by lingchi. With the help of local pirates, the "Folangji" then carried out smuggling at Macao, Lampacau, and St John's Island (now Shangchuan), until Leonel de Sousa legalized their trade with bribes to Admiral Wang Bo (汪柏) and the 1554 Luso-Chinese Accord. The Portuguese undertook not to raise fortifications and to pay customs dues; three years later, after providing the Chinese with assistance suppressing their former pirate allies, the Portuguese were permitted to warehouse their goods at Macau instead of Guangzhou itself.
In October 1646, the Longwu Emperor's brother Zhu Yuyue fled by sea to Guangzhou the last seat of the Ming empire. On 11 December, he declared himself the Shaowu Emperor, borrowing his imperial regalia from local theatre troupes. He led a successful offense against his cousin Zhu Youlang but was deposed and executed on 20 January 1647 when the Ming turncoat Li Chengdong (李成東) sacked the city on behalf of the Qing.
The Qing became somewhat more open to foreign trade after gaining control of Taiwan in 1683. The Portuguese from Macau and Spaniards from Manila returned, as did private Muslim, Armenian, and English traders. From 1699 to 17
Guangzhou