The initial design and construction of the temple took place in the first half of the 12th century, during the reign of Suryavarman II (ruled 1113 – c. 1150). Dedicated to Vishnu, it was built as the king's state temple and capital city. As neither the foundation stela nor any contemporary inscriptions referring to the temple have been found, its original name is unknown, but it may have been known as "Varah Vishnu-lok" after the presiding deity. Work seems to have ended shortly after the king's death, leaving some of the bas-relief decoration unfinished.[8] In 1177, approximately 27 years after the death of Suryavarman II, Angkor was sacked by the Chams, the traditional enemies of the Khmer.[9] Thereafter the empire was restored by a new king, Jayavarman VII, who established a new capital and state temple (Angkor Thom and the Bayon respectively) a few kilometers to the north.