Islam during the Song dynasty
The transition from the Tang to the Song dynasty (960–1279) in China did not greatly interrupt the trends of Muslims established during the Tang. Islam continues to increase its influence. Many Muslims began to go to China to trade during the Tang dynasty. During the Song dynasty, Muslims began to have a greater economic impact and influence on the country. During the Song dynasty (960–1279), Muslims in China dominated foreign trade and the import/export industry to the south and west. Indeed, the office of Director General of Shipping for China's great seaport of  Quanzhou was consistently held by a Muslim during this period. Meanwhile, Arabic storytellers were narrating fantastical stories of China, which were incorporated into the "One Thousand and One Nights" ("Arabian Nights") as the "Tale of Qamar al-Zaman and Budur", "The Story of Prince Sayf al-Muluk", and "The Hunchback's Tale" story cycle. Migration of Muslims to China. During the Song dynasty, an increasing number of foreign Muslims began permanently settling in China and began intermarrying with the locals. In 1070, the Song emperor, Shen-tsung (Shenzong) invited 5,300 Arab men from Bukhara, to settle in China. The emperor  used these men in his campaign against the Liao empire in the northeast. Later on these men were settled between the Sung capital of Kaifeng and Yenching (Yanjing, modern day Beijing). The object was to create a buffer zone between the Chinese and the Liao. In 1080, 10,000 Arab men and women migrated to China on horseback and settled in all of the provinces of the north and north-east. The Arabs from Bukhara were under the leadership of Prince Amir Sayyid "So-fei-er" (). The prince was later given an honorary title. He is reputed of being the "father  of the Muslim community in China. Prior to him Islam was named by the Tang and Song Chinese as the law of the Arabs" (' ; ' derived from the Chinese rendering of "Tazi" — the name the Persian people used for the Arabs). Su fei-erh renamed it to "the religion of the Huihui" ("" ). Some Chinese officials from the Song dynasty era also married women from Dashi (Arabia). Notable Muslims. In 1031, a prominent merchant and Abbasid ambassador called Abu Ali arrived to Emperor Renzong's court to give tribute and gifts. In turn, Renzong rewarded Abu Ali 50,000 ounces of silver. He  soon settled in Guangzhou and married the daughter of a Chinese general. Ali's descendants (with the surname Pu) would hold high positions later in the Song and Yuan dynasties as bureaucrats, statesmen, military officials, Confucian scholars, and influential merchants. In the Song period, a Chinese Muslim called Liang Jie Gu was famed for his medical abilities. His ancestors arrived from Arabia and settled in Kaifeng. The family were given the surname "Liang" by a Song emperor.