In 1291 AD King Mengrai travelled with his troops to invade Hariphunchai and occupied that later for 2 years before he entitled Aifah, his councilor to remain his power. He then traveled eastward and built up a city on the Ping River called "Wiang Gumgam" ; now is in Saraphee District, Chiang Mai. 3 years later he traveled up north and settled at the prime location in the area called "Doi Oichang" or "Doi Suthep" at present. He prefered to set his palace in that place which now became Wat Chiang Mun at present. He invited King Ram Khamheang from Sukhothai Kingdom and King Ngam Mueng from Payao, his good friends to help him to create the new city. After searching through the area on the Ping River with the Suthep Mountain nearby was the best.
King Mengrai conducted the square moat of 800 by 1,000 metres around the new city. Inside, he built up his palace, Wat Chiang Mun and some Buddhist temples to survive the religion. The city was then in 1296AD named as "Nopburi Sri Nakornping Chiang Mai".