The Mataram Kingdom (, , ); was a Javanese Hindu–Buddhist kingdom that flourished between the 8th and 11th centuries. It was based in Central Java, and later in East Java. Established by King Sanjaya, the kingdom was ruled by the Shailendra dynasty and Ishana dynasty. During most of its history the kingdom seems have relied heavily on agriculture, especially extensive rice farming, and later also benefited from maritime trade. According to foreign sources and archaeological findings, the kingdom seems to have been well populated and quite prosperous. The kingdom developed a complex society, had a well developed culture, and achieved a degree of sophistication and refined civilisation. In the period between the late 8th century and the mid-9th century, the kingdom saw the blossoming of classical Javanese art and architecture reflected in the rapid growth of temple construction. Temples dotted the landscape of its heartland in Mataram. The most notable of the temples constructed in Mataram are Kalasan, Sewu, Borobudur and Prambanan, all quite close to present-day city of Yogyakarta. At its peak, the kingdom had become a dominant empire that exercised its power—not only in Java, but also in Sumatra, Bali, southern Thailand, Indianized kingdoms of the Philippines, and the Khmer in Cambodia. Later the dynasty divided into two kingdoms identified by religious patronage—the Buddhist and Shaivite dynasties. Civil war followed. The outcome was that the Mataram kingdom was divided into two powerful kingdoms; the Shaivite dynasty of Mataram kingdom in Java led by Rakai Pikatan and the Buddhist dynasty of Srivijaya kingdom in Sumatra led by Balaputradewa. Hostility between them did not end until 1016 when the Shailendra clan based in Srivijaya incited a rebellion by Wurawari, a vassal of the Mataram kingdom, and sacked the capital of Watugaluh in East Java. Srivijaya rose to become the undisputed hegemonic empire in the region. The Shaivite dynasty survived, reclaimed east Java in 1019, and then established the Kahuripan kingdom led by Airlangga, son of Udayana of Bali. Historiography In the early 19th century, the discovery of numerous ruins of great monuments—such as Borobudur, Sewu and Prambanan—which dominated the landscape of the Kedu and Kewu plains in Yogyakarta and Central Java, caught the attention of some historians and scholars in the colonial Dutch East Indies. This spurred archaeological studies to uncover the history of this ancient civilisation. The history of the Mataram area as the capital of the Central Javanese