The Great Mosque of Xi'an () is one of the largest premodern mosques in China. Although the mosque was first built in the year 742 AD during the Tang dynasty, its current form was largely constructed in 1384 AD during Emperor Hongwu's reign of the Ming dynasty, as recorded by the Records of Xi'an Municipality (). An active place of worship within Xi'an Muslim Quarter, this courtyard complex is also a popular tourist site. It now houses more than twenty buildings in its five courtyards, and covers 1.23 hectares. Etymology and location within Xi'an The mosque is also known as the Huajue Xiang Mosque (), for its location on 30 Huajue Lane. It is sometimes called the Great Eastern Mosque () as well, because it is located in the eastern segments of the Xi'an Muslim Quarter (). The Daxuexi Alley Mosque () sits on the other side of the Muslim Quarter and is known as the "Western Mosque" of Xi'an. History and usage Original mosque during the Tang and Song dynasties Chang'an, as the cosmopolitan capital of China's Tang dynasty, had sizable non-Han merchant and artisan communities that resided there. Many of them migrated to China from today's West Asia. Emperor Xuanzong decreed around the year 742 AD (as Tangmingsi, ) that a place of worship for the Muslim community was to be constructed in the city. It has been argued that, around the same time, mosques for the immigrant population in Quanzhou and Guangzhou were being built. There is evidence that the early mosque was used during the Song dynasty due to the presence of an imperial plaque placed in the mosque issued by the Song government. Due to the collapse of the Tang dynasty and later the Song dynasty, most parts of the original mosque constructed in the Tang dynasty did not survive. The mosque was reconstructed at least four times before taking its modern shape. At around the 1260s, the then deteriorating mosque was rebuilt by the Yuan government as Huihui Wanshansi (). The Mongol conquest of China witnessed a large immigration of Muslims into China. Many were relocated by the Mongol Yuan rulers to serve as bureaucrats and merchants in China. The foreign, often Muslim, population brought into China by the Mongol regime were known in Chinese as People with Coloured Eyes (), many of whom originated from the recently Islamized regions such as Kara-Khanid Xinjiang