King Mangrai, the 25th king of Ngoen Yang of the Lavachakkaraj dynasty, centralized the city-states of Ngoen Yang into a unified kingdom and made an alliance with the neighboring Kingdom of Kingo. In 1262, Mangrai moved the capital from Ngoen Yang (modern Chiang Sæn) to the newly-founded Chiang Rai – naming the city after himself. Mangrai consolidated the north and then expanded to the south and subjugated the Mon Haripunchai kingdom centered on modern Lamphun in 1281. Mangrai swore allegiance with two other kings – Ngam Mueng of Kingo and Ram Khamhæng of Sukhothai in 1276 & 1277 AD respectively.