China is home to a large population of practitioners of Islam. Sources, including the BBC, suggest that there may be as many as 20 million Muslims in China, up to 2% of the country's 1.3 billion population. Other sources suggest Muslims in China number more than 30 million.The biggest titular Muslim ethnic group in China is the Hui, while others include the Uyghurs and the Kazakhs. The largest concentration is found in China's northwestern Xinjiang autonomous region.A unique feature of some modern Muslim practitioners in China is the presence of female imams.

During the Tang Dynasty, China was highly tolerant of new religions and Chinese contact with foreign envoys flourished. Islam was introduced to China via the silk road by Arabs. Although some believe that Islam may have arrived in China during the Sui Dynasty, the first official record of Islam's arrival in China occurred during the Tang Dynasty.

Uthman ibn Affan, the third Caliph of Ummah, sent the first official Muslim envoy to China in 650. The envoy, headed by Sa'ad ibn Waqqas, arrived in the Tang capital, Chang'an, in 651 via the overseas route. Huis generally consider this date to be the official founding of Islam in China. The Ancient Record of the Tang Dynasty recorded the historic meeting, where the envoy greeted Emperor Gaozong of Tang China and tried to convert him to Islam. Although the envoy failed to convince the Emperor to embrace Islam, the Emperor allowed the envoy to proselytize in China and ordered the establishment of the first Chinese mosque in the capital to show his respect for the religion.Arab people are first noted in Chinese written records, under the name Da shi in the annals of the Tang dynasty (618-907). Records dating from 713 speak of the arrival of a Da shi ambassador. It is recorded that in 758, a large Muslim settled in Guangzhou erupted in unrest and fled. The community had constructed a large mosque (Huaisheng Si), 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 and Persian 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 Arab and Persian immigrants introduced polo, their cuisine, their musical instruments, and their knowledge of medicine to China.

The Yuan Dynasty embraced Islam. The Mongols elevated the status of Muslims versus the Chinese, and placed many Muslims in high-ranking posts instead of Confucian scholars, relying on Muslims to administer the empire. The state encouraged Muslim immigration, as Arab, Persian and Turkic immigration into China accelerated during this period.

Muslims continued to flourish in China during the Ming Dynasty. During Ming rule, the capital, Nanjing, was a center of Islamic learning.Mosques in Nanjing are noted in two inscriptions from the sixteenth century.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. One of the more popular Muslim family names is Ma (馬), a shortened form of Fatima.

Muslims suffered a decline of their status during the Qing Dynasty. Numerous Hui rebellions, such as the Panthay Rebellion, sprung up during the Qing Dynasty in reaction to repressionist policies.In the first decade of the 20th century, it has been estimated that there were between 50 million and 3 million Muslims in China proper (that is, China excluding the regions of Mongolia and Xinjiang), with the true number probably lying closer to 20,000,000 or 30,000,000. Of these, almost half resided in Gansu, over a third in Shaanxi (as defined at that time) and the rest in Yunnan.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 religions). 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.

Some Chinese Muslims may have made the Hajj pilgrimage to Mecca on the Arabian peninsula between the fifteenth and eighteenth centuries, yet there is no written record of this prior to 1861, it has been asserted.