History of Islam in China
The history of Islam in China goes back 1,300 years. Origin of Islamic China. According to traditional Chinese Muslim accounts, the history of Islam in China began when four "Ṣaḥābā"—Sa‘d ibn Abī Waqqās (594–674), Ja'far ibn Abi Talib, and Jahsh preached in 616/17 and onwards in China after coming from Chittagong-Kamrup-Manipur route after sailing from Abyssinia in 615/16. Sa‘d ibn Abi Waqqas again headed for China for the third time in 650–51 after Caliph ‘Uthman asked him to lead an embassy to China, which the Chinese emperor received warmly. China-Arab Trade relations . Trade existed between pre-Islamic Arabia and China's South Coast, and flourished when Arab maritime traders converted to Islam. It reached its peak under the Mongol Yuan Dynasty. China's long and interactive relationship with the various steppe tribes and empires, through trade, war, subordination or domination paved the way for a large sustained Islamic community within China. Islamic influence came from the various steppe peoples who assimilated in Chinese culture. Muslims served as administrators, generals, and other leaders who were transferred to China from Persia and Central Asia to administer the empire under the Mongols. Muslims in China  have managed to practice their faith in China, sometimes against great odds, since the seventh century. Islam is one of the religions that is still officially recognized in China. History. According to the historical accounts of Chinese Muslims, Islam was first brought to China by Sa'd ibn abi Waqqas, who came to China for the third time at the head of an embassy sent by Uthman, the third Caliph, in 651, less than twenty years after the death of prophet Muhammad. The embassy was led by Sa`d ibn Abī Waqqās. Emperor Gaozong, the Tang emperor who received the envoy then  ordered the construction of the Memorial mosque in Canton, the first mosque in the country, in memory of the prophet. Hui legends seem to confuse the 651 visit with the initiation of Islam as early as 616/17 by earlier visits of "Sahabas". While modern historians tend to argue that there is no evidence for Waqqās himself ever coming to China, they do believe that Muslim diplomats and merchants arrived in Tang China within a few decades from the beginning of Middle Ages (Hijra). The Tang Dynasty's cosmopolitan culture, with its intensive contacts with Central Asia and its significant communities  of (originally non-Muslim) Central and Western Asian merchants resident in Chinese cities, which helped the introduction of Islam. Tang dynasty. Arab people are first noted in Chinese written records, under the name "Ta shi" in the annals of the Tang Dynasty (618-907) (Ta shi or Da shi is the Chinese rendering of Tazi—the name the Persian people used for the Arabs). Records dating from 713 speak of the arrival of a "Da shi" ambassador. The first major Muslim settlements in China consisted of Arab and Persian merchants. The first encounter between the Tang Chinese and the Umayyad  Arabs occurred in 715 AD when Ikhshid, the king of Fergana Valley, was deposed with the help of the Arabs of the Umayyad Caliphate and a new king Alutar was installed on the throne. The deposed king fled to Kucha (seat of Anxi Protectorate), and sought Chinese intervention. The Chinese sent 10,000 troops under Zhang Xiaosong to Ferghana. He defeated Alutar and the Arab occupation force at Namangan and reinstalled Ikhshid on the throne. In 717 AD the Arabs attacked Transoxiana again hoping to capture the Tang dynasty's Four Garrisons of Anxi district. The Arabs were again routed in  the Battle of Aksu. Subsequently, with Chinese backing, the Turgesh launched punitive attacks into Arab territory eventually wresting all of Ferghana from the Arabs with the exception of a few forts. Despite conflict between the Tang and the Abbasids during the Battle of Talas in 751, relations between the two states improved soon after. In 756, a contingent probably consisting of Persians and Iraqis was sent to Kansu to help the emperor Su-Tsung in his struggle against the rebellion of An Lushan. Less than 50 years later, an alliance was concluded between the Tang and the Abbasids against Tibetan  attacks in Central Asia. A mission from the Caliph Harun al-Rashid (766-809) arrived at Chang'an. It is recorded that in 758, a large Muslim settlement in Guangzhou erupted in unrest and the people fled. The community had constructed a large mosque (Huaisheng Mosque), destroyed by fire in 1314, and constructed in 1349–51; only ruins of a tower remain from the first building. During the Tang Dynasty, a steady stream of Arab (Ta'shi) and Persian (Po'si) traders arrived in China through the silk road and the overseas route through the port of Quanzhou. Not all of the immigrants were  Muslims, but many of those who stayed formed the basis of the Chinese Muslim population and the Hui ethnic group. The Persian immigrants introduced polo, their cuisine, their musical instruments, and their knowledge of medicine to China. Song dynasty. Many Muslims went to China to trade, and these Muslims began to have a great 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. In year 1070, the Song emperor, Shen-tsung (Shenzong) invited 5,300 Muslim 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 (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 Chinese materia medica 52 (re-published in 1968–75) was revised under the Song Dynasty in 1056 and 1107 to include material, particularly 200 medicines, taken from  Ibn Sina's "The Canon of Medicine". The Arabs from Bukhara were under the leadership of Prince Amir Sayyid "So-fei-er" (his Chinese name). 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 "Dashi fa" ("law of the Arabs") (Tashi or Dashi is the Chinese rendering of Tazi—the name the Persian people used for the Arabs). . He renamed it to "Huihui Jiao" ("the Religion of the Huihui"). Pro-Mongol Muslims. Pu Shougeng, a  Muslim foreign trader, stands out in his work to help the Yuan conquer Southern China, the last outpost of Song power. In 1276, Song loyalists launched a resistance to Mongol efforts to take over Fuzhou. The Yuanshih (Yuan dynasty official history) records that Pu Shougeng "abandoned the Song cause and rejected the emperor...by the end of the year, Quanzhou submitted to the Mongols."In abandoning the Song cause, Pu Shougeng mobilized troops from the community of foreign residents,who massacred the Song emperor's relatives and Song loyalists.Pu Shougeng and his troops acted without the help of the  Mongol army. Pu Shougeng himself was lavishly rewarded by the Mongols. He was appointed military commissioner for Fujian and Guangdong Yuan dynasty. The Yuan Dynasty of China continued to maintain an excellent relationship with other nomadic tribes of Mongolia. The Mongol rulers of Yuan Dynasty elevated the status of foreigners of all religions versus the Han, Khitan, and Jurchen, and placed many foreigners such as Muslim Persians and Arabs, Turkic Christians, Jews, Tibetan Buddhist Lamas, and Buddhist Turpan Uyghurs in high-ranking posts instead of native Confucian scholars, using many Muslims in the administration of China. The territory of the  Yuan was administered in 12 districts during the reign of Kublai Khan with a governor and vice-governor each. According to Iranian historian Rashidu'd-Din Fadlu'llah, of these 12 governors, 8 were Muslims; in the remaining districts, Muslims were vice-governors. At the same time the Mongols imported Central Asian Muslims to serve as administrators in China, the Mongols also sent Han Chinese and Khitans from China to serve as administrators over the Muslim population in Bukhara in Central Asia, using foreigners to curtail the power of the local peoples of both lands. The state forced massive numbers of Central  Asian Muslims to move into China during the Yuan period. In the fourteenth century, the total population of Muslims was 4,000,000. It was during this time that Jamal ad-Din, a Persian astronomer, presented Kublai Khan with seven Persian astronomical instruments. Also, The Muslim architect Yeheidie'erding (Amir al-Din) learned from Han architecture and helped to design and construct the capital of the Yuan Dynasty, Dadu, otherwise known as Khanbaliq or Khanbaligh. In the mid-14th century, the Ispah Rebellion against the Mongol Yuan led by Chinese Persian Muslims broke out in South Fujian. After the rebellion was suppressed the local  Han Chinese in Quanzhou turned against Semu people and great misery was brought upon Muslim population. Quanzhou itself ceased to be a leading international seaport. Genghis Khan and the following Yuan emperors forbade Islamic practices like Halal butchering, forcing Mongol methods of butchering animals (similar to Jhatka, and believed by Buddhists to induce less suffering) on Muslims, and other restrictive degrees continued. Muslims had to slaughter sheep in secret. Genghis Khan directly called Muslims and Jews "slaves", and demanded that they follow the Mongol method of eating rather than the halal method. Circumcision was also forbidden. Jews were also affected , and forbidden by the Mongols to eat Kosher. Toward the end, corruption and the persecution became so severe that Muslim generals joined Han Chinese in rebelling against the Mongols. The Ming founder Zhu Yuanzhang had Muslim generals like Lan Yu who rebelled against the Mongols and defeated them in combat. Some Muslim communities had the name in Chinese which meant "barracks" and also mean "thanks", many Hui Muslims claim it is because that they played an important role in overthrowing the Mongols and it was named in thanks by the Han Chinese for assisting them. Dadu would last until 1368  when Zhu Yuanzhang, the founder of the Ming Dynasty and future Hongwu Emperor, made his imperial ambitions known by sending an army toward the Yuan capital. The last Yuan emperor fled north to Shangdu and Zhu declared the founding of the Ming Dynasty after razing the Yuan palaces in Dadu to the ground. The city was renamed Beiping by the Ming in the same year. Anti-Muslim persecution by the Yuan dynasty and Ispah rebellion. The Yuan dynasty started passing anti-Muslim and anti-Semu laws and getting rid of Semu Muslim privileges towards the end of the Yuan dynasty , in 1340 forcing them to follow Confucian principles in marriage regulations, in 1329 all foreign holy men including Muslims had tax exemptions revoked, in 1328 the position of Muslim Qadi was abolished after its powers were limited in 1311. In the middle of the 14th century this caused Muslims to start rebelling against Mongol Yuan rule and joining rebel groups. In 1357-1367 the Yisibaxi Muslim Persian garrison started the Ispah rebellion against the Yuan dynasty in Quanzhou and southern Fujian. Persian merchants Amin ud-Din (Amiliding) and Saif ud-Din) Saifuding led the revolt. Persian official Yawuna assassinated both  Amin ud-Din and Saif ud-Din in 1362 and took control of the Muslim rebel forces. The Muslim rebels tried to strike north and took over some parts of Xinghua but were defeated at Fuzhou two times and failed to take it. Yuan provincial loyalist forces from Fuzhou defeated the Muslim rebels in 1367 after A Muslim rebel officer named Jin Ji defected from Yawuna. The Muslim merchants in Quanzhou who engaged in maritime trade enriched their families which encompassed their political and trade activities as families. Historians see the violent Chinese backlash that happened at the end of  the Yuan dynasty against the wealth of the Muslim and Semu as something inevitable, however anti-Muslim and anti-Semu laws had already been passed by the Yuan dynasty. In 1340 all marriages had to follow Confucian rules, in 1329 all foreign holy men and clerics including Muslims no longer were exempt from tax, in 1328 the Qadi (Muslim headmen) were abolished after being limited in 1311. This resulted in anti-Mongol sentiment among Muslims so some anti-Mongol rebels in the mid 14th century were joined by Muslims. Quanzhou came under control of Amid ud-Din (Amiliding) and Saif  ud-Din (Saifuding), two Persian military officials in 1357 as they revolted against the Mongols from 1357 to 1367 in southern Fujian and Quanzhou, leading the Persian garrison (Ispah) They fought for Fuzhou and Xinghua for 5 years. Both Saifuding and Amiliding were murdered by another Muslim called Nawuna in 1362 so he then took control of Quanzhou and the Ispah garrison for 5 more years until his defeat by the Yuan. Yuan Massacres of Muslims. The historian Chen Dasheng theorized that Sunni-Shia sectarian war contributed to the Ispah rebellion, claiming that the Pu family and their in-law  Yawuna were Sunnis and there before the Yuan while Amiliding and Saifuding's Persian soldiers were Shia originally in central China and moved to Quanzhou and that Jin Ji was a Shia who defected to Chen Youding after Sunni Yawuna killed Amiliding and Saifuding. Three fates befell the Muslims and foreigners in Quanzhou, the ones in the Persian garrison were slaughtered, many Persians and Arab merchants fled abroad by ships, another small group that adopted Chinese culture were expelled into coastal Baiqi, Chendi, Lufu and Zhangpu and mountainous Yongchun and Dehua and one other part took refuge in Quanzhou's  mosques. The genealogies of Muslim families which survived the transition are the main source of information for the rebellion times. The Rongshan Li family, one of the Muslim survivors of the violence in the Yuan-Ming transition period wrote about their ancestors Li Lu during the rebellion who was a businessman and shipped things, using his private stores to feed hungry people during the rebellion and using his connections to keep safe. The Ming takeover after the end of the Persian garrison meant that the diaspora of incoming Muslims ended. After the Persian garrison full and the rebellion was crushed , the common people started a slaughter of the Pu family and all Muslims: "All of the Western peoples were annihilated, with a number of foreigners with large noses mistakenly killed while for three days the gates were closed and the executions were carried out. The corpses of the Pus were all stripped naked, their faces to the west. ... They were all judged according to the "five mutilating punishments" and then executed with their carcasses throwing into pig troughs. This was in revenge for their murder and rebellion in the Song.’’ 80 merchant ships were commanded by Fo Lian, from Bahrain  who was Pu Shougeng's son-in-law. The Qais born Supterintendent of Taxes for Persian and the Island, Jamal al-din Ibrahim Tibi had a son who was sent in 1297-1305 as an envoy to China. Wassaf, and Arab historian said that Jamal became wealthy due to trade with India and China. Patronage networks and monopolies controlled Yuan maritime trade unlike in the Song dynasty where foreigners and Chinese of the Song merchant elite reaped profits. Quanzhou's end as an international trading port was rapid as in 1357 rebellions broke out in central China so the Persian  merchants Amin ud-din (Amiliding) and Saif ud-din (Saifuding) led soldiers to take over Quanzhou. A Pu family relative by marriage, Yawuna, another Muslim assassinated those two. The Muslim rebels of the Persian garrison in Quanzhou lasted a decade by exploiting maritime trade and plunder. Yawuna and his army were captured and defeated by provincial forces in 1366 and then the Ming took over Quanzhou 2 years later in 1368. Maritime trade was regulated and implemented extremely differently in the Ming dynasty. Guangzhou, Ningbo and Quanzhou all had maritime trade offices but they were limited to specific areas. The  South Sea trade was no longer permitted in Quanzhou and only trade with Ryukyu was allowed in Quanzhou. The Muslim community in Quanzhou became a target of the people's anger. In the streets there was widescale slaughter of "big nosed" westerners and Muslims as recorded in a genealogical account of a Muslim family. The era of Quanzhou as an international trading port of Asia ended as did the role of Muslims as merchant diaspora in Quanzhou. Some Muslims fled by sea or land as they were persecuted by the locals and others tried to hide and lay low as  depicted in the genealogies of Quanzhou Muslims despite the Ming emperors attempted to issue laws tolerating Islam in 1407 and 1368 and putting the notices in mosques. Qais was the island of Kish and its king Jamal al-Din Ibrahim bin Muhammad al-Tibi briefly seized control of Hormuz while he traded with China and India and earned great wealth from it. One of Sayyid Ajall Shams al-Din Omar's descendants, the Jinjiang Ding fled to Chendai (Jinjiang on the coast of Quanzhou to avoid the violence of the Ispah rebellion. The Li family survived through philanthropy activities however  they said that in the rebellion "great families scattered from their homes, which were burned by the soldiers, and few genealogies survived." and used the words "a bubbling cauldron" to describe Quanzhou. In 1368 Quanzhou came under Ming control and the atmosphere calmed down for the Muslims. The Ming Yongle emperor issued decrees of protection from individuals and officials in mosques such as Quanzhou mosques and his father before him Ming Taizu had support from Muslim generals in his wars to reunify the country so he showed tolerance to them. The Ming passed some laws saying that Muslims not use  Chinese surnames. Some genealogies of Muslims like the Li family show debate over teaching Confucian culture and classics like Odes and History or to practice Islam. Ming Taizu passed laws concerning maritime trade which were the major impact upon the life of Quanzhou Muslims. He restricted official maritime trade in Quanzhou to Ryukyu and Guangzhou was to monopolize south sea trade in the 1370s and 1403-1474 after initial getting rid of the Office of Maritime Trade altogether in 1370. Up to the late 16th century, private trade was banned. Persian Sunni Muslims Sayf al-din (Sai-fu-ding) and  Awhad al-Din (A-mi-li-ding) started the Ispah rebellion in 1357 against the Yuan dynasty in Quanzhou and attempted to reach Fuzhou, capital of Fujian. Yuan general Chen Youding defeated the Muslim rebels and slaughtered Muslims of foreign descent in Quanzhou and areas next to Quanzhou. This led to many Muslim foreign fleeing to Java and other places in Southeast Asia to escape the massacres, spreading the Islamic religion. Gresik was ruled by a person from China's Guangdong province and it had a thousand Chinese families who moved there in the 14th century with the name Xin  Cun (New Village) in Chinese. THis information was reported by Ma Huan who accompanied Zheng He to visit Java in the 15th century. Ma Huan also mentions Guangdong was the source of many Muslims from China who moved to Java. Cu Cu/Jinbun was said to be Chinese. And like most Muslims form China, Wali Sanga Sunan Giri was Hanafi according to Stamford Raffles. Ibn Battuta had visited Quanzhou's large multi-ethnic Muslim community before the Ispah rebellion in 1357 when Muslim soldiers attempted to rebel against the Yuan dynasty. In 1366 the Mongols slaughtered the Sunni Muslims of  Quanzhou and ended the rebellion. The Yuan dynasty's violent end saw repeated slaughters of Muslims until the Ming dynasty in 1368. The role of trade in Quanzhou ended as Sunni Muslims fled to Southeast Asia from Quanzhou. The surviving Muslims who fled Quanzhou moved to Manila bay, Brunei, Sumatra, Java and Champa to trade. Zheng He's historian Ma Huan noticed the presence of these Muslim traders in Southeast Asia who had fled form China in his voyages in Barus in Sumatra, Trengganu on the Malayan peninsula, Brunei and Java. The Nine Wali Sanga who converted Java to Islam  had Chinese names and originated from Chinese speaking Quanzhou Muslims who fled there in the 14th century around 1368. The Suharto regime banned talk about this after Mangaradja Parlindungan, a Sumatran Muslim engineer wrote about it in 1964. Ming dynasty. Muslims continued to flourish in China during the Ming Dynasty. During Ming rule, the capital, Nanjing, was a center of Islamic learning. The Ming dynasty saw the rapid decline in the Muslim population in the sea ports. This was due to the closing of all seaport trade with the outside world. However it also saw the appointment of Muslim military  generals such as Mu Ying who campaigned in Yunnan and central Shandong. These two areas became leading centers of Islamic learning in China. The emperor Zhu Yuanzhang was the founder of the Ming Dynasty. Many of his most trusted commanders were Muslims, including Hu Dahai, Mu Ying, Lan Yu, Feng Sheng and Ding Dexing. The Ming Dynasty also gave rise to the famous Muslim explorer Zheng He. Muslims in Ming dynasty Beijing were given relative freedom by the Chinese, with no restrictions placed on their religious practices or freedom of worship, and being normal citizens in Beijing. In contrast to  the freedom granted to Muslims, followers of Tibetan Buddhism and Catholicism suffered from restrictions and censure in Beijing. Integration. Both Mongol and Central Asian Semu Muslim women and men of both sexes were required by Ming Code to marry Han Chinese after the first Ming Emperor Hongwu passed the law in Article 122. Immigration slowed down drastically, however, and the Muslims in China became increasingly isolated from the rest of the Islamic world, gradually becoming more sinicized, adopting the Chinese language and Chinese dress. During this period, Muslims also began to adopt Chinese surnames. Other Muslims, who could not find  a Chinese surname similar to their own, adopted the Chinese character most similar to their own - Ma (馬) for Muhammad, Mai for Mustafa, Mu for Masoud, Ha for Hasan, Hu for Hussain and Sa'I for Said and so on. The Hui, Salar, and Dongxiang are Muslims in China who use Chinese surnames. As a result, the Muslims became "outwardly indistinguishable" from the Chinese. In addition to names, Muslim customs of dress and food also underwent a synthesis with Chinese culture.The Islamic modes of dress and dietary rules were maintained within a Chinese cultural framework. In time, the immigrant Muslims  began to speak local dialects and to read in Chinese. After the Oghuz Turkmen Salars moved from Samarkand in Central Asia to Xunhua, Qinghai in the early Ming dynasty, they converted Tibetan women to Islam and the Tibetan women were taken as wives by Salar men. A Salar wedding ritual where grains and milk were scattered on a horse by the bride was influenced by Tibetans. After they moved into northern Tibet, the Salars originally practiced the same Gedimu (Gedem) variant of Sunni Islam as the Hui people and adopted Hui practices like using the Hui Jingtang Jiaoyu Islamic education  during the Ming dynasty which derived from Yuan dynasty Arabic and Persian primers. One of the Salar primers was called "Book of Diverse Studies" (雜學本本 Zaxue Benben) in Chinese. The version of Sunni Islam practiced by Salars was greatly impacted by Salars marrying with Hui who had settled in Xunhua. The Hui introduced new Naqshbandi Sufi orders like Jahriyya and Khafiyya to the Salars and eventually these Sufi orders led to sectarian violence involving Qing soldiers (Han, Tibetans and Mongols) and the Sufis which included the Chinese Muslims (Salars and Hui). Ma Laichi brought the Khafiyya Naqshbandi order to the  Salars and the Salars followed the Flowered mosque order (花寺門宦) of the Khafiyya. He preached silent dhikr and simplified Qur'an readings bringing the Arabic text Mingsha jing (明沙經, 明沙勒, 明沙爾 Minshar jing) to China. The Kargan Tibetans, who live next to the Salar, have mostly become Muslim due to the Salars. The Salar oral tradition recalls that it was around 1370 in which they came from Samarkand to China. The later Qing dynasty and Republic of China Salar General Han Youwen was born to a Tibetan woman named Ziliha (孜力哈) and a Salar father named Aema (阿额玛). Tibetan women were  the original wives of the first Salars to arrive in the region as recorded in Salar oral history. The Tibetans agreed to let their Tibetan women marry Salar men after putting up several demands to accommodate cultural and religious differences. Hui and Salar intermarry due to cultural similarities and following the same Islamic religion. Older Salars married Tibetan women but younger Salars prefer marrying other Salars. Han and Salar mostly do not intermarry with each other unlike marriages of Tibetan women to Salar men. Salars however use Han surnames. Salar patrilineal clans are much more limited than Han patrilinial clans  in how much they deal with culture, society or religion. Salar men often marry a lot of non-Salar women and they took Tibetan women as wives after migrating to Xunhua according to historical accounts and folk histories. Salars almost exclusively took non-Salar women as wives like Tibetan women while never giving Salar women to non-Salar men in marriage except for Hui men who were allowed to marry Salar women. As a result, Salars are heavily mixed with other ethnicities. Salars in Qinghai live on both banks of the Yellow river, south and north, the northern ones are  called Hualong or Bayan Salars while the southern ones are called Xunhua Salars. The region north of the Yellow river is a mix of discontinuous Salar and Tibetan villages while the region south of the yellow river is solidly Salar with no gaps in between, since Hui and Salars pushed the Tibetans on the south region out earlier. Tibetan women who converted to Islam were taken as wives on both banks of the river by Salar men. The term for maternal uncle (ajiu) is used for Tibetans by Salars since the Salars have maternal Tibetan ancestry. Tibetans witness Salar life  passages in Kewa, a Salar village and Tibetan butter tea is consumed by Salars there as well. Other Tibetan cultural influences like Salar houses having four corners with a white stone on them became part of Salar culture as long as they were not prohibited by Islam. Hui people started assimilating and intermarrying with Salars in Xunhua after migrating there from Hezhou in Gansu due to the Chinese Ming dynasty ruling the Xunhua Salars after 1370 and Hezhou officials governed Xunhua. Many Salars with the Ma surname appear to be of Hui descent since a lot of Salars now have  the Ma surname while in the beginning the majority of Salars had the Han surname. Some example of Hezhou Hui who became Salars are the Chenjia (Chen family) and Majia (Ma family) villages in Altiuli where the Chen and Ma families are Salars who admit their Hui ancestry. Marriage ceremonies, funerals, birth rites and prayer were shared by both Salar and Hui as they intermarriaed and shared the same religion since more and more Hui moved into the Salar areas on both banks of the Yellow river. Many Hui married Salars and eventually it became far more popular for Hui  and Salar to intermarry due to both being Muslims than to non-Muslim Han, Mongols and Tibetans. The Salar language and culture however was highly impacted in the 14th-16th centuries in their original ethnogenesis by marriage with Mongol and Tibetan non-Muslims with many loanwords and grammatical influence by Mongol and Tibetan in their language. Salars were multilingual in Salar and Mongol and then in Chinese and Tibetan as they trade extensively in the Ming, Qing and Republic of China periods on the yellow river in Ningxia and Lanzhou in Gansu. Salars and Tibetans both use the term maternal uncle  (ajiu in Salar and Chinese, azhang in Tibetan) to refer to each other, referring to the fact that Salars are descendants of Tibetan women marrying Salar men. After using these terms they often repeat the historical account how Tibetan women were married by 2,000 Salar men who were the First Salars to migrate to Qinghai. These terms illustrate that Salars were viewed separately from the Hui by Tibetans. According to legend, the marriages between Tibetan women and Salar men came after a compromise between demands by a Tibetan chief and the Salar migrants. The Salar say Wimdo valley was ruled  by a Tibetan and he demanded the Salars follow 4 rules in order to marry Tibetan women. He asked them to install on their houses's four corners Tibetan Buddhist prayer flags, to pray with Tibetan Buddhist prayer wheels with the Buddhist mantra om mani padma hum and to bow before statues of Buddha. The Salars refused those demands saying they did not recite mantras or bow to statues since they believed in only one creator god and were Muslims. They compromised on the flags in houses by putting stones on their houses' corners instead of Tibetan Buddhist prayer flags . Some Tibetans do not differentiate between Salar and Hui due to their Islamic religion. In 1996, Wimdo township only had one Salar because Tibetans whined about the Muslim call to prayer and a mosque built in the area in the early 1990s so they kicked out most of the Salars from the region. Salars were bilingual in Salar and Tibetan due to intermarriage with Tibetan women and trading. It is far less likely for a Tibetan to speak Salar. Tibetan women in Xiahe also married Muslim men who came there as traders before the 1930s. In eastern Qinghai and Gansu  there were cases of Tibetan women who stayed in their Buddhist Lamaist religion while marrying Chinese Muslim men and they would have different sons who would be Buddhist and Muslims, the Buddhist sons became Lamas while the other sons were Muslims. Hui and Tibetans married Salars. Qing dynasty. Qing Dynasty (1644–1911) was ruled by the Manchus. In the Qing Dynasty, Muslims had many mosques in the large cities, with particularly important ones in Beijing, Xi'an, Hangzhou, Guangzhou, and other places (in addition to those in the western Muslim regions). The architecture typically employed traditional Chinese styles, with Arabic-language inscriptions  being the chief distinguishing feature. Many Muslims held government positions, including positions of importance, particularly in the army. As travel became easier, there were many exchanges between China and the outside world. Around this time, Chinese Muslims also became the first Muslims in New Zealand (See Islam in New Zealand). Sufism spread throughout the Northwestern China in the early decades of the Qing Dynasty (mid-17th century through early 18th century). The most important Sufi orders ("menhuan") included: The Manchu Kangxi emperor incited anti-Muslim sentiment among the Mongols of Qinghai (Kokonor) in order to gain support against the Dzungar Oirat  Mongol leader Galdan. Kangxi claimed that Chinese Muslims inside China such as Turkic Muslims in Qinghai (Kokonor) were plotting with Galdan, who he falsely claimed converted to Islam. Kangxi falsely claimed that Galdan had spurned and turned his back on Buddhism and the Dalai Lama and that he was plotting to install a Muslim as ruler of China after invading it in a conspiracy with Chinese Muslims. Kangxi also distrusted Muslims of Turfan and Hami. The Uyghur Muslim Sayyid and Naqshbandi Sufi rebel of the Afaqi suborder, Jahangir Khoja was sliced to death (Lingchi) in 1828 by the Manchus for  leading a rebellion against the Qing. Ming loyalist Muslims. When the Qing dynasty invaded the Ming dynasty in 1644, Muslim Ming loyalists in Gansu led by Muslim leaders Milayin and Ding Guodong led a revolt in 1646 against the Qing during the Milayin rebellion in order to drive the Qing out and restore the Ming Prince of Yanchang Zhu Shichuan to the throne as the emperor. The Muslim Ming loyalists were supported by Hami's Sultan Sa'id Baba and his son Prince Turumtay. The Muslim Ming loyalists were joined by Tibetans and Han Chinese in the revolt. After fierce fighting , and negotiations, a peace agreement was agreed on in 1649, and Milayan and Ding nominally pledged allegiance to the Qing and were given ranks as members of the Qing military. When other Ming loyalists in southern China made a resurgence and the Qing were forced to withdraw their forces from Gansu to fight them, Milayan and Ding once again took up arms and rebelled against the Qing. The Muslim Ming loyalists were then crushed by the Qing with 100,000 of them, including Milayin, Ding Guodong, and Turumtay killed in battle. The Confucian Hui Muslim scholar Ma Zhu (1640-1710) served  with the southern Ming loyalists against the Qing. Dungan and Panthay Revolts. During the time, the Muslims revolted against the Qing Dynasty, most notably in the Dungan revolt (1862–1877) and the Panthay rebellion (1856-1873) in Yunnan. One million people died in the Panthay rebellion, several million people died in the Dungan revolt. However, Muslims in other parts of China proper like in the east and southern provinces who did not revolt, were not affected at all by the rebellion, and experienced no genocide, nor did they seek to revolt. It was reported that Muslim villages in Henan province, which  was next to Shaanxi, were totally unaffected and relations between Han and Hui continued normally. The Hui Muslim population of Beijing was unaffected by the Muslim rebels during the Dungan revolt. Elisabeth Allès wrote that the relationship between Hui Muslim and Han peoples continued normally in the Henan area, with no ramifications or consequences from the Muslim rebellions of other areas. Allès wrote, "The major Muslim revolts in the middle of the nineteenth century which involved the Hui in Shaanxi, Gansu and Yunnan, as well as the Uyghurs in Xinjiang, do not seem to have had any direct effect on  this region of the central plain." Many Muslims like Ma Zhan'ao, Ma Anliang, Dong Fuxiang, Ma Qianling, and Ma Julung defected to the Qing dynasty side, and helped the Qing general Zuo Zongtang exterminate the Muslim rebels. These Muslim generals belonged to the Khafiya sect, and they helped Qing massacre Jahariyya rebels. General Zuo moved the Han around Hezhou out of the area and relocated them as a reward for the Muslims there helping Qing kill other Muslim rebels. In 1895, another Dungan Revolt (1895) broke out, and loyalist Muslims like Dong Fuxiang, Ma Anliang, Ma Guoliang, Ma Fulu, and  Ma Fuxiang suppressed and massacred the rebel Muslims led by Ma Dahan, Ma Yonglin, and Ma Wanfu. A Muslim army called the Kansu Braves led by General Dong Fuxiang fought for the Qing dynasty against the foreigners during the Boxer Rebellion. They included well known Generals like Ma Anliang, Ma Fulu, and Ma Fuxiang. In Yunnan was noted that the Qing armies only massacred the Muslims who had rebelled, and spared Muslims who took no part in the uprising. The Ush rebellion in 1765 by Uyghurs against the Manchus occurred after Uyghur women were gang raped by the servants and  son of Manchu official Su-cheng. It was said that "Ush Muslims had long wanted to sleep on [Sucheng and son's] hides and eat their flesh." because of the rape of Uyghur Muslim women for months by the Manchu official Sucheng and his son. The Manchu Emperor ordered that the Uyghur rebel town be massacred, the Qing forces enslaved all the Uyghur children and women and slaughtered the Uyghur men. Manchu soldiers and Manchu officials regularly having sex with or raping Uyghur women caused massive hatred and anger by Uyghur Muslims to Manchu rule. The invasion by Jahangir Khoja  was preceded by another Manchu official, Binjing who raped a Muslim daughter of the Kokan aqsaqal from 1818 to 1820. The Qing sought to cover up the rape of Uyghur women by Manchus to prevent anger against their rule from spreading among the Uyghurs. The Manchu official Shuxing'a started an anti-Muslim massacre which led to the Panthay Rebellion. Shuxing'a developed a deep hatred of Muslims after an incident where he was stripped naked and nearly lynched by a mob of Muslims. He ordered several Muslim rebels to be slow sliced to death. Tariq Ali wrote about the real incident  in one of his novels, claiming the Muslims who had nearly lynched Shuxing'a were not Hui Muslims but belonged to another ethnicity but nevertheless the Manchu official blamed all Muslims for the incident. In addition to sending Han exiles convicted of crimes to Xinjiang to be slaves of Banner garrisons there, the Qing also practiced reverse exile, exiling Inner Asian (Mongol, Russian and Muslim criminals from Mongolia and Inner Asia) to China proper where they would serve as slaves in Han Banner garrisons in Guangzhou. Russian, Oirats and Muslims (Oros. Ulet. Hoise jergi weilengge niyalma) such as Yakov and Dmitri  were exiled to the Han banner garrison in Guangzhou. In the 1780s after the Muslim rebellion in Gansu started by Zhang Wenqing 張文慶 was defeated, Muslims like Ma Jinlu 馬進祿 were exiled to the Han Banner garrison in Guangzhou to become slaves to Han Banner officers. The Qing code regulating Mongols in Mongolia sentenced Mongol criminals to exile and to become slaves to Han bannermen in Han Banner garrisons in China proper.