Phimeanakas (Khmer: ប្រាសាទភិមានអាកាស, Prasat Phimean Akas, 'celestial temple') or Vimeanakas (Khmer: ប្រាសាទវិមានអាកាស, Prasat Vimean Akas) at Angkor, Cambodia, is a Hindu temple in the Khleang style, built at the end of the 10th century, during the reign of Rajendravarman (from 941-968), then rebuilt by Suryavarman II in the shape of a three tier pyramid as a Hindu temple. On top of the pyramid there was a tower.
According to legend, the king spent the first watch of every night with a woman thought to represent a Nāga in the tower, during that time, not even the queen was permitted to intrude. Only in the second watch the king returned to his palace with the queen. If the naga who was the supreme land owner of Khmer land did not show up for a night, the king's day would be numbered, if the king did not show up, calamity would strike his land. Source http://en.wikipedia.org/wiki/Phimeanakas