The kingdom of Lanna was founded in 1261 by King Mangrai, an exiled prince from the kingdom of Dali. The capital of Lanna was called Chiang Rai but it was moved to Chiang Mai due to the destruction by the Hong in a war in 1422
King Mangrai was exiled from Dali in 1260 by his older brother who was the king for plotting to overthrow him due to his incompetent rule. This plan failed and the king of Dali sent an army to defeat him. Gathering all the supporters, he organized a militia force of 50,000 men to face the 100,000 strong Dali army. Mangrai was defeated and retreated out of Dali.
He settled in Northern Thailand. He united the many tribes in the region under his rule.
The King of Dali, who was very old at this point saw the rising power that his younger brother had created. He decided to invade Lanna in 1293. However, Mangrai defeated the Dali army and routed them.
In 1422, Hong China invaded Lanna for the pretense of imprisoning and torturing Chinese traders suspected for being spies. The capital of Chiang Rai was sacked and Lanna sued for peace. Lanna became a vassal of the Hong Dynasty.
In 1794, Ayutthaya invades and conquers the kingdom of Lanna