According to ancient Chinese court records, in 651 A.D. the first Arab emissary reached Chang’an, the capital of the Tang Dynasty (618– 907). According to Muslims traditional accounts, the emissary included Uthman Waqqas (or Sa’d ibn Abi Waqqas), the maternal uncle of the prophet Muhammad. Hence, the year 651 A.D. is commonly recognized as the entry of Islam into China. However, evidence would suggest that some Arab-Muslim traders had reached China by sea route before that time.
The first Muslim community in China consisted of Arab and Persian merchants who took residence in port cities including Guangzhou, Quanzhou, Fuzhou, and Yangzhou. With the passage of the time, some native Chinese, Turkish, and Mongol converts joined the Muslim communities and helped to spread Islam spread in China. In 755, a so-called Shi’i rebellion took place and lasted seven years during which a large area of the northern territory of China was captured. The Chinese government asked for military support from the Arab empire in order to put down the rebellion. In 756, some 4,000 Muslim soldiers moving by land route joined the Chinese government troops and defeated the rebellion. After the war, Muslim soldiers were given an option of remaining in China, whereupon many elected to stay, increasing the number of Muslims in China.
In following Song Dynasty (618-1279 A.D.) more traders from Arabia and Persia settled down in coastal areas They married indigenous women and the government gave them preferential treatment by allowing them Islamic rule of law as well as places to live and build mosques. They were calledFan Ke(lit. foreign quests) while the places where they lived were calledFan Fang(lit. foreign settlements).
By the Song Dynasty (960—1279), Muslims began to play an important role in the import and export industry; shipping was consistently controlled by Muslim officers. In 1070, the Song emperor Shenzong invited 5,300 Muslim men from Bukhara to resist the invasion of the Liao emperor from northeast China. These men later settled between Kaifeng (then capital of the Song Dynasty) and Yanjing (present day Beijing). Muslims in the Tang and Song Dynasties established their own schools in their settlements to educate young generations and maintain their beliefs and cultural identities. These schools were called “Fan Xue” (lit. foreign schools or foreign learning).