Built at the end of the 10th century, the Phimeanakas or celestial temple was dedicated to the ruler Rajendravarman. According to a legend, the ruler spent the first watch of each night with a woman thought to representa Naga, in the now non-existent tower.
Only on the second watch could the king return to his queen. If the king did not show, calamity would strike. If the Naga did not come, his days were numbered.