As more Hui Huis continued coming in from the west, Islam spread widely to the Chinese interior. The system of Fan Fang(foreign settlement) practiced in the Tang and Song periods became less efficient in administrating religious and ethnic affairs in the Yuan Dynasty. So the Department of Qadi was set up in both central and local governments to be in charge specifically of the interior matters of the Hui Huis and their religious affairs. Wherever the Hui Huis were of large number, a local Department of Qadi was set up to handle religious, civil and penal affairs among Muslims.
Qadi is a word originated from Arabic, meaning executive officer of Islamic Law, who is authorized to judge civil, commercial and penal affairs among Muslims in accordance with Islamic law. During the first half of the Yuan period, Qadi was the supreme religious personnel of Islam, who was preacher, religious leader, judicial and executive officer and commander of Muslims as well. He enjoyed very high religious and social status, and was respectfully called master by the court.
The Department of Qadi that appeared in the Yuan Dynasty was composed of a certain number of Qadis, whose responsibility was to pray for good fortune for the emperor, deal with religious affair, preach at gathering prayers, judge on religious, civil and penal affairs among the Muslims in accordance with Islamic law, and administrate Islamic internal matters.
Qadis were both government officials and Muslims' religious leaders. Therefore, the system of Qadi was a combination of religion with politics and autonomy to some extent. To set up the Department of Qadi for the first time in the Yuan Dynasty, the emperor issued an imperial order to ratify it and specify its functions and powers so as to govern all Muslims in China.
During the mid and late period of the Yuan Dynasty (mid- 14th century), the Department of Qadi was eventually abolished, but Qadis still existed. They were not in charge of praying for good fortune for the country and the emperors any longer, but still functioned as judges to settle judicial matters among Muslims until the end of the Yuan Dynasty.
The establishment of the Department of Qadi was of great importance to the further development of Islam in China. What Qadis did in the Yuan Dynasty such as praying for good fortune for the Non-Muslim Mongol emperors and eulogizing their wisdom and bravery, laid the theoretic foundation for the Theory of Double Loyalties (loyal to Allah, and loyal to the supreme ruler as well), a theory advanced by the Hui scholars in Ming and Qing period.
As the Muslim population and the number of the mosques kept increasing, it became increasingly necessary to satisfy the needs of Muslims' religious life. Thereupon, the system ofQadi changed, and a new system called "Triple-Party Administration"canie into being.
"Triple-Panv Administration" mean? three parlies, namely [main. Khatib and Mu'adhdhin together iidministraie Islamic affairs. This system wa.s established in me Ming DynasP,'. Tt was ;i creation of Chine'ie Islam and i-.'ire in Islamic countries ;md regions. It was also the result of the development and evolution ofl.slam in Chinese historical conditions.
As the Department of Qadi was evenuially abolished during tlie mid to late period of llie Yuan Dynasty. Jiao Fang (Muslim settlement I took its place. Jiao Fang was actually a special type of organization without any official nature. It was neither an executive institution on certain levels nor subordinate to any executive institutions, but a sort of religious organization for Muslims' common religious activities within the imperial system. It was characterized by:l) Jiao Fangs were independent to each other, not subordinate to each other; 2) they were exclusive, not related to each other; 3) each Jiao Fang took a mosque as center and organized a community that covered religious, political, economic, cultural and civil affairs and social activities; 4) the affairs of Jiao Fang were separated from that of the mosque but related to it to some extent.
This sort of organization appeared in cities first. As the policy of combining the army with peasants was put into practice in the Yuan Dynasty, Jiao Fangs also appeared in the countryside. The mosque was the core of Jiao Fang, and the basic condition for its birth and growth.
In the Yuan Dynasty, mosques were built wherever the Muslims were concentrated throughout the country. It was a symbol that Islam had successfully taken root in China. As a religious site, mosque played an important role in intensifying Muslims' faith and educating Muslims to perform religious services and fulfill religious assignments. It was in control of the Muslims' spiritual world in a sense. In the Yuan Dynasty the site where Muslims performed prayers (actually mosques) did not yet have a fixed name. They were called by different names such as "Li Bai Si" (prayer temple), "Hui Hui Si" (Hui Huis' temple), "Hui Hui Tang" (Hui Huis' hall), "Zhen Jiao Si" (temple of revealed religion) or "Qing Jing Si" (clear and clean temple). Compared to that in Tang and Song period, the function of the mosque became more diversified during the Yuan Dynasty. It was not only a place where the Muslims performed prayers, but also a rostrum where they learned and preached Islam, also a public place where the Imam and other Islamic leaders handled the internal matters of the community, a place where Muslims commemorated the old sages of the past, and also a service center where Muslims could seek help on many things. Later it developed into the center of Mosque Education (Islamic education conducted in mosques). As the system ofjiao Fang developed and matured, the economic and public welfare and free schools within Jiao Fang developed and emerged one after another, making the mosque which was the center of Jiao Fang an important place for the Muslims' social life. Innumerable mosques were built or rebuilt during the Yuan and early Ming dynasties (the 13th century to the middle of the 14th century). Unfortunately, due to wars and natural disasters. many of them have been destroyed. The ones still in existence today are of the following: the Zheng Jiao (or Feng Huang) Mosque in Hangzhou, the Song Jiang Mosque in Shanghai, the Nan Cheng Mosque and the Yong Nian Mosque in Kunming, the Qing Zhen Mosque in Fuzhou, the Zhen Jiao Mosque in Qingzhou, Shandong, the Hua Jue Mosque in Xi'an, the Jing Jue Mosque in Nanjing, the Great Southern Mosque in Jinan, the Niu Jie Mosque and the Dong Si Mosque in Beijing.