According to the chronicles and archaeological evidence, the old city was built by King Mangrai around the latter part of the 13th century.
The city was established as a new capital by the King of Ngoenyang after his victory over the Mon people's kingdom of Hariphunchai, modern Lamphun.
The people were moved back to this area again more than 200 years later with a new community, and it was then named Chang Kham village (บ้านชั่งคำ).
In 1984, the Department of Fine Arts Unit 4 discovered remnants of the old city around Wihan Kan Thom (วิหารกานโถม) at Wat Chang Kham (วัดช้างค้ำ) and afterwards excavation was begun; since then many new remains have been found and restoration has proceeded since that time.
In keeping with its Mon roots, Brahma, the Hindu creator, is venerated at the temple in addition to Buddhism.
Wat Phrachao Ong Dam (Thai: วัดพระเจ้าองค์ดำ; "Temple of the Black-Bodied Lord") is named after a burnt bronze Buddha image that was discovered at the site.