The name "Hariharalaya" is derived from the name of Harihara, a Hindu deity prominent in pre-Angkorian Cambodia. The name "Harihara" in turn is a composite of "Hari" (meaning the Hindu god Vishnu) and "Hara" (meaning the Hindu god Shiva). Cambodian representations of Harihara were of a male deity whose one side bore the attributes of Vishnu and whose other side bore the attributes of Shiva. For example, the deity’s head covering consisted in a mitre-type hat (the attribute of Vishnu) on one side and as twisted locks of hair (the attribute of Shiva) on the other.
Toward the end of the 8th century A.D., the Cambodian king Jayavarman II conquered vast territories near the great lake Tonle Sap. For at least part of this time, he established his capital at Hariharalaya. However, when he declared himself the universal monarch of the country in 802 A.D., he did so not at Hariharalaya, but at a location on the Kulen Plateau. Later, he returned the capital to Hariharalaya, where he died in 835.
Jayavarman II was succeeded by Jayarvarman III and then by Indravarman I, who were responsible for the construction of the royal temple mountain known as the Bakong. Indravarman I consecrated the temple’s dominant religious symbol, a lingam called Sri Indresvara (the name is a combination of the king’s name with that of Shiva), in 881. Indravarman I also constructed the much smaller temple today called Preah Ko ("Sacred Bull"), dedicated in 880. In 889, Indravarman I was succeeded by his son Yasovarman I, who constructed the temple of Lolei (the name may be a modern corruption of "Hariharalaya"). Yasovarman also founded a new city at the site of Angkor Thom north of modern Siem Reap and called it Yasodharapura. Yasovarman made the new city his capital and constructed a new royal temple mountain, known as the Bakeng. Yasodharapura was to survive until the 1170’s when it was sacked by invaders from Champa.