Mataram was an Indianized kingdom based in Central Java between the 8th and 10th centuries AD and was established by a raja of the same name. Although
initially eclipsed in power by the rival Sailendra Dynasty, by 850 it had become the dominant power in Java and was a serious rival to the hegemonic
Srivijaya Empire.
From the time of its founding until 928, the kingdom was ruled by the Sanjaya Dynasty, at which point the centre of the kingdom was moved from Central Java
to East Java by Mpu Sindok, who established the Isyana Dynasty. The move may have been caused by an eruption of the volcano Gunung Merapi or a power
struggle.
The first king of Mataram was Sanjaya, who left inscriptions in stone, although little is known about the kingdom at this time due to the dominance of the
Sailendra. The monumental Hindu temple of Prambanan in the vicinity of Yogyakarta was built by Daksa, and Dharmawangsa ordered the translation of the
Mahabharata into Old Javanese in 996.
The kingdom collapsed at the end of Dharmawangsa's reign under military pressure from Srivijaya. Airlangga, a son of Udayana of Bali and a relative of
Dharmawangsa re-established the kingdom (including Bali) under the name of Kahuripan. In 1045 Airlangga abdicated his throne to resume the life of an
ascetic, and divided the kingdom between his two sons, Jangala and Kediri and from this point on the kingdom is known as Kediri.