The Funan kingdom was eventually supplanted by the Chenla kingdom but still retained the social, political and religious institutions from the earlier kingdom. During this time the kingdom expanded to include all of Laos and west into southern Thailand. Internal disputes caused the kingdom to split into Land Chenla (Upper) and Water Chenla (Lower). While Land Chenla remained relatively stable, Water Chenla came under the control of the Sailendra dynasty of Java. This lasted until a Khmer prince, Jayavarman II, having spent time in the Sailendra court, returned to Cambodia and declared all the areas inhabited by the Khmer people independent from Java. Having proclaimed himself universal monarch, Jayavarman instituted the cult of Devaraja, which conferred divine status upon the ruler. He relocated the capital north of the Tonle Sap at Hariharalaya near Angkor and reunited the two Chenlas thus founding the famed Khmer Empire. His successors would begin building on the site at Angkor, which included the construction of an elaborate system of canals and reservoirs to provide irrigation for wet rice cultivation. This was a key to their prosperity and signalled the golden age of the Khmer Empire. It was during this time that the great temple complexes were built along with a system of roads and elevated causeways, rest houses and hospitals.
The Khmer Empire would flourish for over 600 years and at its zenith in the 12 century covered most of the Southeast Asian peninsula. The kingdom suffers repeated invasions by the Annamese and the Champas from present day Vietnam. Under Jayavarman VII, the Khmers would conquer the Champas and the kingdom would reach its largest extent. Jayavarman VII would convert to Buddhism, making it the national religion and begin construction on a new temple complex Angkor Thom in 1200. Having over extended themselves in terms of territory and financing the lavish constructions couple with the deterioration of the irrigation system that fuelled their economy, this would signal the beginning of the end for the Khmer Empire. The Thai kingdoms in the west now threatened them and in the 15th century, Ayutthaya captured the capital at Angkor.