Following the oil boom of Miri in the early 1900s, the town's population increased rapidly before an unknownepidemic began to strike the town resulting in the deaths of many of the town's population. The localChineseresidents believed the epidemic was caused by evil spiritsroaming around the area. A Chineseman named Chan Chak began calling a monk to appease the spirits with a spirit-pacifying ritual being carried out near the Miri River and with an altar being placed there. When the epidemic began to subside following the ritual, the local Chinese residents constructed a temple near the river to revere Tua Pek Kong in gratitude to the latter in 1913. The temple remains to this day having survived the Japanese bombings on the town during World War II. It was renovated in 1977. In 2017, a new paifang has been constructed for the temple.