The Viharn Nam Tam structure of this temple complex is believed to be the oldest surviving wooden religious building in Thailand dating back to the 16th century. The main gate of the temple was constructed in the late 15th century. The temple was built on the site of an 8th century fortification, called a Wiang , used to protect the main transportation routes to the then feudal city of Lampang.