At the end of Yuan Dynasty and the beginning of Ming Dynasty, due to military campaigns, deployment, immigration, business and other reasons, a large number of Muslims from all over the country moved in, which was the formation period of Muslims in Shanxi. According to the appraisal of ancient architecture experts, the large-scale temples of the ancient Muslim temples in Taiyuan were built in the late Yuan Dynasty and early Ming Dynasty, which proved that there were quite a few Hui people in Taiyuan in the late Yuan Dynasty and early Ming Dynasty. Hong Wunian and Zhu Yuanzhang enfeoffed the kings and screened the royal family. According to Ming History, "Twenty-six Wang Julu". Lu is now Changzhi City. In the sixth year of Yongle in the Ming Dynasty (A.D. 1408), Zhu Mo, the Excalibur King, was made a native of Changzhi. Among the guards who moved to Luzhou, there were more than 100 Hui people, mostly Ma and Cheng from Shuiximen, Nanjing. Among them, soldiers, craftsmen and businessmen settled in Guo Tong, Nantou and Yingkou around Changzhi Imperial City. The Hui Zhen nationality in Youyu County in Yanbei region originated from Kyoto in Ming Dynasty, and has existed in Youyu for 19 generations, about 500 years. The signboard of Wang Shengyuan Hotel opened by a Hui nationality surnamed Zhen was once marked with the words "Kyoto Hui". By the end of the Qing Dynasty, the Hui nationality surnamed Zhen was the richest man in Youyu.
During the Yongle period of the Ming Dynasty, the immigration policy was implemented, and there was an immigration station in Hongtong County, Shanxi Province, which was a distribution center for immigrants. The top ten Hui people in Taiyuan are Duo, Luo, Tian, Liang, Li, Jin, Sa, Hai, Dao and Di, most of whom came from this immigration. Among them, Jin and Liang are from Nanjing. During this period, some Hui people went to Shanxi to do business, such as Yang, Ding and Ma from Taiyuan, who settled in Shanxi from Shaanxi-Gansu-Ningxia, and Tian, who did business in Hohhot, Inner Mongolia, settled in Taiyuan.
After the late Ming and early Qing Dynasties, the Hui people who moved to Shanxi from Shaanxi, Henan, Ningxia, Hebei, Shandong and other places stayed in Jincheng, Yuncheng and other places in Shanxi due to war, famine, business and other reasons. For example, the Hui people in Jiangxian County settled in the fifth year of Chongzhen in the Ming Dynasty (AD 1632). In the sixth year of Shunzhi, the Hui people were transferred to other places. Now there is a Hui nationality named Ma in Youyu County, who moved in from Shandong. According to its genealogy, there have been 13 generations in Youyu County for about 300 years. During the same period, the Hui people in Ma Jiahui Village of Datong County also moved in from Xuanhua area of Hebei Province. In the twenty years of Daoguang, some Hui people in Huaiqing Prefecture of Henan moved into Jincheng Chengguan. In the early years of Tongzhi, after the failure of the northwest Hui people's uprising against Qing Dynasty, they settled in Jincheng in two batches, about 100 households with more than 500 people. Most of the Hui people in Yuanqu, Xinjiang and Hejin counties in Yuncheng area moved in from Henan in the Qing Dynasty. Since Zhengzhou-Taiyuan Railway 1907 was opened to traffic, many Hui people in Shijiazhuang and Baoding of Hebei Province have made a living and settled in Taiyuan and Jinzhong successively.
After liberation, with the mobilization of cadres and workers and civil marriage, some Hui people moved to Shanxi from Hebei, Beijing, Inner Mongolia, Henan and other places.