The Phimeanakas is a small temple with an intriguing legend behind it. It sits near the center of the royal enclosure, which once held the palace and apartments of the king and his many concubines. The palace buildings were made of wood, so nothing of them remains. Phimeanakas was the king's personal temple, and dates from the late tenth century, before Jayavarman VII built the Angkor Thom royal city around it.
The Phimeanakas Temple, within the royal enclosure at Angkor Thom.
The legend relates that a nine-headed serpent genie once inhabited the golden pavilion on top of the Phimeanakas. Each night, the king ascended to the top of the temple, where the genie would appear to him disguised as a woman. The king was required to make love to the genie every night before joining his wives and concubines in the palace. If the king missed just one night, it was believed he would die.
Yeah... rrright... Sounds like a 'guy' story to me.
Phimeanakas is accessible from the Terrace of the Elephants. However, another route is to walk through the gate that connect the Baphuon to the royal enclosure. You can continue on a northward path, past the bathing pools, to visit Preah Palilay.