View on Explorer →Race its rivals →

South & Southeast Asia

Medang Kingdom

Peak825 CE
Duration284 yrs
Period732 CE – 1016 CE
CapitalMataram (near Yogyakarta or Muntilan); Mamrati and Poh Pitu in the Kedu Plain; Tamwlang and Watugaluh near Jombang from 929; Wwatan near Madiun
FounderRakai Mataram Sang Ratu Sanjaya, who erected a lingga at Canggal in 732
Preceded byThe kingdom of King Sanna, Sanjaya's uncle; before it Kalingga on the north coast of Central Java
Succeeded byThe kingdom of Kahuripan, re-established by Airlangga in 1019

6 min read · Last reviewed October 2026

At a glance

  • The 150 years from Panangkaran to Balitung (760–910) were the apogee of classical Javanese civilisation, when Kalasan, Sewu, Borobudur and Prambanan rose on the Kedu and Kewu plains.
  • Under the Shailendras Javanese fleets raided Tonkin in 767 and Champa in 774 and 787, Dharanindra took Ligor and became Maharaja of Srivijaya, and the young Jayavarman II lived at the Javanese court before proclaiming Cambodia's independence in 802.
  • The centre moved to East Java about 929 under Mpu Sindok; Dharmawangsa's naval invasion of Srivijaya in 990 failed, and in 1016–1017 the vassal king of Wurawari destroyed the palace and killed him at his daughter's wedding.

Rise & Fall

Peak 825 CE1732: Sanjaya erects a lingga on the hill at Canggal; the inscription names him Rakai Mataram Sang Ratu Sanjaya, lord of Mataram.2778: Panangkaran builds the Kalasan temple to the goddess Tara and a monastery for Buddhist monks of the Shailendra realm.3787: Javanese fleets raid Champa a second time and burn the temple at Phan Rang, after demolishing Po Nagar at Nha Trang in 774.4825: Samaratungga completes Borobudur, the stone mandala begun under Dharanindra.5856: The Shivagrha inscription records Rakai Pikatan's victory over a rebel in a hill fortress and the consecration of the Shiva temple at Prambanan.6898: On 10 May Balitung takes the throne, reunites the kingdom after thirteen years of turmoil and for the first time brings parts of East Java under Mataram.7929: Mpu Sindok moves the capital to Tamwlang in East Java and founds the Isyana dynasty.81016–1017: Haji Wurawari attacks from Lwaram, destroys the palace and kills Dharmawangsa and most of the royal family: the pralaya of Mataram.732 CE1016 CE
Relative power on the Institute's 0–10 scale (each profile scaled to its own peak). Numbers mark the key events below.
  1. 732Sanjaya erects a lingga on the hill at Canggal; the inscription names him Rakai Mataram Sang Ratu Sanjaya, lord of Mataram.
  2. 778Panangkaran builds the Kalasan temple to the goddess Tara and a monastery for Buddhist monks of the Shailendra realm.
  3. 787Javanese fleets raid Champa a second time and burn the temple at Phan Rang, after demolishing Po Nagar at Nha Trang in 774.
  4. 825Samaratungga completes Borobudur, the stone mandala begun under Dharanindra.
  5. 856The Shivagrha inscription records Rakai Pikatan's victory over a rebel in a hill fortress and the consecration of the Shiva temple at Prambanan.
  6. 898On 10 May Balitung takes the throne, reunites the kingdom after thirteen years of turmoil and for the first time brings parts of East Java under Mataram.
  7. 929Mpu Sindok moves the capital to Tamwlang in East Java and founds the Isyana dynasty.
  8. 1016–1017Haji Wurawari attacks from Lwaram, destroys the palace and kills Dharmawangsa and most of the royal family: the pralaya of Mataram.

Foundation

Canggal inscription
Canggal inscriptionGunawan Kartapranata, CC BY-SA 3.0

The Medang Kingdom, which its own inscriptions call Mataram and which this profile names as the register does, is first recorded in the Canggal inscription of 732, found at the Gunung Wukir temple southwest of Magelang. Written in Sanskrit in the Pallava script, it tells of a lingga raised on a hill in the Kunjarakunja area of Yawadwipa, a noble island rich in rice and gold, on the orders of Rakai Mataram Sang Ratu Sanjaya. Java had been ruled by King Sanna, whose long reign was wise and virtuous; after his death the kingdom fell into disunity until Sanjaya, son of Sanna's sister Sannaha, took the throne, conquered the surrounding lands and brought peace. Sanjaya seems to have come to power about 717.

The Carita Parahyangan, a Sundanese text of the late 16th century, makes Sanjaya Sanna's son, tells how Sanna was defeated by Purbasora of Galuh and how Sanjaya avenged him and ruled West, Central and East Java and Bali; romanticised as it is, its agreement with the Canggal inscription suggests a historical core. Mataram is Sanskrit for motherland; the name is first found in the Wuatan Tija inscription of 880, while Medang, perhaps from the medang hardwood tree, names the palace within it. Sanjaya was a Shaivite; his successor Panangkaran was a Mahayana Buddhist, a shift that divides historians between two rival dynasties, Sanjaya and Shailendra, and a single Shailendra house that changed its patronage.

Socioeconomy

Borobudur
BorobudurHeri nugroho, CC BY-SA 4.0

Mataram relied above all on agriculture, especially intensive wet-rice cultivation on the fertile volcanic soil of Central Java, which let the population grow and supplied the labour for the kingdom's public works. Most inscriptions record the grant of sima, taxed wet-rice land recognised by royal edict, often with part or all of its rice tax assigned to build and maintain a temple; a sima was made by opening forest or converting dry ladang to irrigated sawah, and the villages throughout the realm paid their taxes in rice. The Wonoboyo hoard of gold found in 1990, dated to Balitung's reign, with gold coins shaped like corn seeds and stamped "ta" for tahil, shows an economy partly monetised.

The reliefs of Borobudur and Prambanan show soldiers, officials, court servants, travelling musicians and dancers, food and drink sellers, couriers, sailors, merchants, even thugs and robbers, beside the farmers who were the majority. Society recognised the Hindu four varnas but applied them less rigidly than India; Pigeaud divides it into rulers, religious authority, commoners and slaves, de Casparis into the court people, the priests and monks, and the commoners. In the East Javanese period the Waharu IV (931) and Garaman (1053) inscriptions record labour imported from Jenggi (Zanzibar), Pujut and Bondan to carry and pack crops for the ports; Naerssen thinks they came by purchase or as prisoners of war made slaves.

Military

Nakhon Si Thammarat
Nakhon Si ThammaratSeksan Phonsuwan, CC BY 3.0

The Shailendra kings were sea raiders as well as temple builders. In 767 Javanese and Kunlun ships raided Tonkin. In 774 Javanese or Kunlun vessels attacked Po Nagar at Nha Trang in Champa, carried off the temple's linga and set fire to it; the Cham inscription there describes "men born in other lands, living on other foods, frightful to look at, unnaturally dark and lean, cruel as death, passing over the sea in ships". In 787 the armies of Java, "having come in vessels", burned the temple at Phan Rang. Dharanindra (r. 780–800), hailed in the Kelurak inscription of 782 as "the slayer of courageous enemies", took the Shailendras' power to Ligor on the Malay Peninsula and rose to be Maharaja of Srivijaya, by conquest or by kinship.

Sulaiman recorded in 851 a Javanese surprise attack on the Khmer, approaching the capital by river after a sea crossing, after which the young Khmer king was punished and his kingdom made a vassal. At home the Shivagrha inscription of 856 records a war against Rakai Pikatan fought at a fortress on a hill protected by stone walls, won by his youngest son Dyah Lokapala. The Anjukladang inscription of 937 rewards a village for repelling invaders from Malayu, that is Srivijaya, and in 990 Dharmawangsa launched a naval invasion to capture Palembang: Java's envoys of 992 told the Chinese court of continuous war, and Srivijaya had recovered by 1003.

Governance & Law

Mahabharata
MahabharataPublic domain

The king was the chakravartin, paramount ruler, governing the nagara or kadatwan from his puri, a walled palace of wooden pavilions. Administration had two levels, the court and the wanua villages. Between them stood officials titled Rakai or Samget, landed gentry who ruled a watak of several villages and passed the king's orders to the Rama, the village heads. Balitung, king from 10 May 898, centralised authority, restricted the aristocrats' autonomy, on 12 November 904 freed all Buddhist monasteries from tax, and in the Mantyasih (907) and Wanua Tengah III (908) inscriptions listed his predecessors back to Sanjaya, perhaps to legitimise an irregular accession.

Kingship changed hands uneasily. After Lokapala's death in 885 three kings followed in two years, and from 887 to 894 there was no single ruler until Jebang and then Balitung reunited the realm; Daksha, Balitung's prime minister, issued charters on his own authority before succeeding him around 910. Queens could rule: Pramodhawardhani stood beside Pikatan, and Isyana Tunggawijaya succeeded her father Sindok. Religion and state were intertwined. Sanjaya was Shaivite, Panangkaran through Samaratungga Buddhist, Pikatan Shaivite again, yet Buddhist Plaosan, Banyunibo and Sajiwan rose in his reign, and brahmins and the sangha conducted the rituals of state. Dharmawangsa ordered the Mahabharata translated into Old Javanese in 996.

Global & Regional Impact

Mendut
MendutChainwit., CC BY 4.0

The Mataram era is hailed as the classical period of Javanese civilisation. Between Panangkaran and Balitung the Kedu and Kewu plains filled with temples: Kalasan and Sari (778), the 249-structure Manjusrigrha or Sewu complex (792), Mendut, Pawon and Borobudur (completed about 825), Plaosan, and the Shivagrha of Prambanan, the largest Hindu temple ever built in Indonesia, raised by Pikatan in 856 and expanded through Lokapala and Balitung. Shailendra sculpture is counted among the finest Buddhist art in the world, and Borobudur's reliefs give the most complete rendering of the Karmavibhanga, Lalitavistara, Jataka, Avadana and Gandavyuha texts.

Javanese art spread with Javanese power. The Avalokiteshvaras of Bingin Jungut in Sumatra, Bidor in Perak and Chaiya in southern Thailand show Central Javanese influence long mislabelled Srivijayan, and the Bakong in Cambodia so resembles Borobudur that travellers or missions must have carried its design to the Khmer. The Khmer prince Jayavarman II spent years at the Shailendra court before returning around 790 to rule as devaraja and proclaim independence from Java in 802, founding the Angkor era. The name Mdaη appears in the Laguna Copperplate Inscription of the Philippines, dated 900. Balaputra, displaced in Java, became Maharaja of Srivijaya and in his Nalanda inscription of 860 claimed the Shailendra inheritance.

Decline & Fall

Airlangga
AirlanggaGunawan Kartapranata, CC BY-SA 3.0

Around 929 Mpu Sindok moved the centre of the kingdom from Central to East Java, to Tamwlang and then Watugaluh near Jombang, founding the Isyana dynasty though closely related to the old house. Van Bemmelen blames a great eruption of Merapi in Wawa's reign, the Pralaya Mataram; Krom proposed an epidemic, Schrieke the burden of temple-building on peasants who drifted east; Coedès and de Casparis saw a retreat from the Buddhist Shailendras or from Srivijayan invasion, and de Casparis noted that the Brantas valley gave access to the north-coast ports and the Maluku spice trade which the isolated Kedu plain lacked.

In the late 10th century the rivalry with Srivijaya turned to war. Dharmawangsa, who had moved the capital to Wwatan near Madiun and married his sister Mahendradatta to Udayana Warmadewa of Bali, invaded Srivijaya by sea in 990 to take Palembang; the Maharaja Sri Cudamani Warmadewa won Chinese support and repelled the invasion. In 1016–1017 the vassal king of Wurawari, in the Banyumas area, struck from Lwaram during the wedding of Dharmawangsa's daughter, destroyed the palace and killed the king and most of the royal family. Javanese accounts call it the pralaya, the debacle. Airlangga, son of Udayana and Mahendradatta and the dead king's nephew, escaped to the Vanagiri forest, rallied support and in 1019 re-established the kingdom, including Bali, as Kahuripan, its capital near the Brantas estuary.

The Medang Kingdom, the Mataram of its inscriptions, was the Hindu-Buddhist kingdom of Central and later East Java from Sanjaya's lingga of 732 to the pralaya of 1016–1017, whose Shailendra kings built Borobudur and Prambanan, raided Champa and Cambodia and ruled Srivijaya, and whose last king Dharmawangsa died when the vassal Wurawari destroyed his palace.

Test yourself

5 questions on this page, from its key events and facts.

The questions open here once the page has loaded.

References

  • R. Soekmono, Pengantar Sejarah Kebudayaan Indonesia 2 (Penerbit Kanisius, 1973)
  • F. D. K. Bosch, Srivijaya, de Sailendravamsa en de Sanjayavamsa (1952)
  • Jan Wisseman Christie, "States without Cities: Demographic Trends in Early Java", Indonesia 52 (1991)