Angkor Wat was built as a funerary temple for Suryavarman II in the 12th century.