Chiang Mai was founded in the year 1297 by King Mengrai as the capital of the Lanna Kingdom (the kingdom of a million fields). He had established the city of Chiang Rai and also captured Haripunchai (Lamphun today). Legend has it that there the three kings in ally: King Mengrai, King Ramkhamhaeng of Sukhothai and King Ngam Muang of Phayao built the new city (Chiang Mai) together. The location was chosen after an auspicious sighting there: an assembly of rare animals namely 2 white sambar deer, 2 white barking deer and a white mouse with a family of 5.
Mengrai’s dynasty lasted for another 200 years, and the golden age was in the 15th century. The kingdom grew and had reaches from northern Thailand, to north-western Laos, Eastern Burma and southern China.
But Lanna Kingdom was being attacked on both sides from Burma and Ayutthaya, and Chiang Mai finally fell to the Burma under King Bayinnaung in 1558. Most of Lanna was under Burmese control for over two centuries.
Chiang Mai was finally recaptured in 1776, but the city was impoverished that it was abandoned. Its population was moved to Lampang.
In 1796, Chiang Mai was revived and repopulated and a son of the Prince of Lampang was appointed as ruler. With Siamese Thais as allies, the city gained strength and remained semi-autonomous until the late 19th century.
And in 1932, Chiang Mai became a province of Siam, which is now known as Thailand.