In the 12th century AD, the Cham fought a series of wars with the Angkorian Khmer to the west. In 1177, the Cham and their allies launched an attack from the lake Tonlé Sap and managed to sack the Khmer capital. In 1181, however, they were defeated by the Khmer King Jayavarman VII