After King Mhangrai had established himself as the first king of Lanna, he was able to expand his empire by acquiring the city of Hariphunchai in 1281 A.D. King Mhangrai then established the city of Wiang Kum Kam during the years of 1286-1295. While governing Wiang Kum Kam, the King was actively encouraging Buddhism as a means of creating a peaceful society for his people. He established trade contacts with other neighboring regions, and enacted the ‘Mhangrai Sastra’ (King Mhangrai’s Law Code) as a guide for governing the citizens. Thus, King Mhangrai’s people began to prosper, especially in agriculture. They began to trade with other regions, and they demonstrated their faith in Buddhism by constructing Buddhist temples.