Kingdom of Dali
Founded in 765, Kunming was known to the Chinese as "Tuodong" () city in the Kingdom of Nanzhao (737–902) during the 8th and 9th centuries. Tuodong later became part of the successor Kingdom of Dali (937–1253). The possession of Tuodong changed hands when the city came under the control of the Yuan dynasty invasion of the southwest in 1252–1253. During the reign of provincial governor Ajall Shams al-Din Omar, a "Chinese Style" city named Zhongjing Chen was founded where modern Kunming is today. Shams al-Din ordered the construction of Buddhist temple, a Confucian temple, and two mosques in the city. The Confucian temple, doubling as a school, was the first of its kind in Yunnan, attracting students from minority groups across the province. Coupled with his promotion of Confucian ceremonies and customs, Shams al-Din has been largely credited with the sinicization of the region. The city grew as a trading center between the southwest and the rest of China. It is considered by scholars to have been the city of Yachi Fu (Duck Pond Town) where people had used cowries as cash and ate their meat raw, as described by the 13th-century Venetian traveler Marco Polo.