By the 14th century, the total population of Muslims in China had grown to 4 million. After Mongol rule had been overthrown by the Ming Dynasty in 1368, this led to a violent Chinese backlash against West and Central Asians. In order to contain the violence, 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. Han women who married Hui men became Hui, and Han men who married Hui women also became Hui.