As outlined in the preceding gallery, Prasat Hin Phimai was built in the late 11th or early 12th century and was likely used as a royal temple by the king, Jayavarman VI, a Mahayana Buddhist. The most significant Khmer sanctuary in Thailand, Phimai predates famed Angkor Wat in Cambodia and is among the largest of all Khmer temples. Part of its significance lies in the fact that it was not built as a Hindu temple but was in fact created as a Buddhist temple. The complex was restored in the late 12th to early 13th centuries by Jayavarman VII, who, like Jayavarman VI , was a devout Mahayana Buddhist. Architectural design innovations introduced at Phimai were to affect the design of later Khmer sanctuaries—notably and most immediately that of Angkor Wat, built soon after Phimai.