# Mataram–Srivijayan wars

Mataram–Srivijayan wars, also called as Pralaya (lit. 'Destruction') in Javanese inscription of Pucangan, were a military engagements between two rival kingdoms of the Srivijaya of Shailendra and Mataram kingdom of Ishana, intermittently from c. 937 when the Srivijayan forces attempted to approach the Mataram capital, until 1016 when the kingdom of Mataram was collapsed due to a rebellion incited by Srivijaya.

## Background

The monarch of the Mataram kingdom way before the eastern rule of Ishana was Samaratungga of the Shailendra dynasty. He had one son, Balaputradewa, and one daughter, Pramodhawardhani. The successor of Samaratungga was his Buddhist daughter, Pramodhawardhani that betrothed to Rakai Pikatan of Sanjaya, son of the influential Rakai Patapan, a landlord in Central Java. Rakai Pikatan and the Sanjaya dynasty were Shivaite Hindus and are recorded in the Shivagrha inscription as having married a daughter of another religion.$^{:108}$
However, Balaputra opposed the rule of Pikatan and Pramodhawardhani. The relations between Balaputra and Pramodhawardhani is interpreted differently by some historians. According to Bosch and De Casparis holds that Balaputra was the son of Samaratungga, which means he was the younger brother of Pramodhawardhani. Later historians such as Muljana, argued that Balaputra was the son of Samaragrawira and the younger brother of Samaratungga, which means he was the uncle of Pramodhawardhani.
It is not known whether Balaputra was expelled from Central Java because of succession dispute with Pikatan, or was he already ruled in Suvarnadvipa (Sumatra). Either ways, it seems that Balaputra eventually ruled the Sumatran branch of Shailendra dynasty and enthroned in Srivijayan capital of Palembang. Historians argued that this was because Balaputra's mother—Tara, the queen consort of King Samaragrawira was the princess of Srivijaya, this rendered Balaputra as the heir of Srivijayan throne. Balaputra, the Maharaja of Srivijaya later stated his claim as the rightful heir of Shailendra dynasty from Java, as proclaimed in Nalanda inscription dated 860.$^{:108}$
In c. 929, the centre of the kingdom was shifted from Central Java to East Java by Mpu Sindok,$^{:128}$ who established a new dynasty, Ishana dynasty, named after his daughter. The exact cause of the move is still uncertain. Historians have proposed various possible causes; from natural disaster, epidemic outbreak, politics and power struggle, to religious or economic motives.
One of the proposed causes of the move is a politics and power struggle. Coedes suggested that the move to East Java was probably in response to the Buddhist Shailendra dynasty.$^{:79,90}$ This theory is inline with the one proposed by J.G. de Casparis which suggests that the shift of capital city eastward was to avoid a Srivijayan invasions from Sumatra.
However, De Casparis then expands his theory that it was most likely motivated by economic reasons, saying that the location of the kingdom in Central Java was less accessible than East Java. The Brantas river valley was considered to be a strategic location, as the river provides easy access to reach ports on East Java's north coast and Java Sea, strategic for the control of maritime trade routes to the eastern parts of archipelago, being especially vital for control of the Maluku spice trade. But the reasons of the move are still unclear.

## History
### Malayu invasion of 937

According to J.G. de Casparis, the villagers of Anjukladang was awarded for their service and merit on assisting the king's forces — under the leadership of Mpu Sindok, to repel the invading Malayu (Sumatran, highly possible referring Srivijaya) army that tried to approach the capital and has reached the area near Nganjuk. This means, the relations between Mataram kingdom with Srivijaya has badly deteriorated to the state of hostility.$^{:130}$ In addition, According to de Casparis, the Anjukladang inscription mentioned that Mpu Sindok has erected a monument of victory (jayastambha) after successfully repelled the invasion of Malayu, and in the year c. 937, the monument was replaced by a temple. Most likely, the sacred building mentioned in this inscription was referring to the Lor temple, a temple ruins made of red bricks located in the Candirejo village.
The animosity was probably caused by the Srivijayan effort to reclaim Shailendran lands in Java, or by Mataram aspirations to challenge Srivijaya dominance as the regional power.

### Mataram invasion of Srivijaya (990–1006)

In 990, Dharmawangsa launched a naval invasion against Srivijaya$^{:130}$ in an attempt to capture Palembang. The news of Javanese invasion of Srivijaya was recorded in Chinese accounts from Song period. In 988, an envoy from Srivijaya was sent to Chinese court in Guangzhou. After sojourned for about two years in China, the envoy learned that his kingdom has been attacked by the Javanese Mataram, thus made him unable to return home.
The hostility between Srivijaya and Mataram was confirmed by the Javanese envoy. In 992, the envoy from Mataram arrived in Chinese court and explaining that their country has involved in continuous war with Srivijaya.$^{:200}$
In 992, Mataram was succeeded in capturing Palembang for a while, but then Mataram forces were repulsed by Srivijayan troops.
In 999, the Srivijayan envoy sailed from China to Champa in an attempt to return home, however he received no news about the condition of his kingdom.$^{:89}$ The Srivijayan envoy then sailed back to China and appealed Chinese emperor (probably Emperor Zhenzong) for the protection of China from Javanese invaders.$^{:229}$
Dharmawangsa's campaign against Srivijaya led the Sri Cudamani Warmadewa, Maharaja of Srivijaya to seek protection to China.$^{:141}$ In the midst of crisis brought by Javanese invasion, he secured Chinese political support by appeasing the Chinese emperor. In 1003, a Song historical record reported that the envoy of Srivijaya dispatched by Sri Cudamani Warmadewa, informed that a Buddhist temple had been erected in their country to pray for the long life of Chinese emperor, thus asked the emperor to give the name and the bell for this temple which was built in his honour. Rejoiced, the emperor named the temple Ch'eng-t'en-wan-shou (ten thousand years of receiving blessing from heaven, which is China) and a bell was immediately cast and sent to Srivijaya to be installed in the temple.$^{:6}$
By 1005, Srivijaya started to appear victoriously. In 1006, Srivijayan alliance proved its resilience by successfully repelling the Javanese invasion, The invasion was ultimately unsuccessful. This attack has opened the eyes of Srivijayan Maharaja of how dangerous Javanese Mataram could be, and further contemplate, patiently laid a plan and effort to destroy his Javanese nemesis.
Cudamani Warmadewa died in c. 1008, He was succeeded by his heir, Sri Maravijayottungavarman.

### Wurawari rebellion

In 1016, Srivijaya launched a retaliation attack and destroyed the Wwatan Palace in Java, by assisting the lesser king of Mataram vassal polity, Wurawari of Lwaram to revolt, attacked and destroyed the Mataram palace. The reason Wurawari rebelled was because previously, he wanted to marry the daughter of Dharmawangsa. He wants to replace Dharmawangsa and become the ruler of Mataram. However, his proposal was rejected, and Dharmawangsa chose Airlangga, son of Udayana Warmadewa of Bali and Mahendradatta,$^{:129}$ as his son-in-law. Wurawari was vengeful, he allied with Srivijaya to help attack the palace. The sudden and unexpected attack took place during the wedding ceremony of Dharmawangsa's daughter, killing Dharmawangsa and most of the royal family.$^{:130}$
This calamity was recorded in Javanese account as the Pralaya (the debacle); "the death of the Mataram kingdom".$^{:144}$ With the death of Dharmawangsa and the fall of the capital, under military pressure from Srivijayan forces assisting Wurawari, the kingdom finally collapsed and fell to chaos. With the absence of Mataram paramount ruler, warlords in regional provinces and settlements in central and east Java rebelled and break loose from the central Mataram government and forming their own polities serving local dynasties. Raids and robbery were rampant ravaging the country. There was further unrest and violence several years after the kingdom's demise.

## Aftermath

Airlangga managed to escape the destruction and went into exile in Vanagiri forest in interior Central Java. He later rallied support from officials and regents that are loyal to the former Ishana dynasty and began to reunite the areas that had formerly been ruled by the Mataram kingdom. He consolidated his authority, re-established the kingdom under the name of Kahuripan, and made peace with Srivijaya. This kingdom can be considered as the successor state of Mataram kingdom, and from this point on, the kingdom was known as Kahuripan,$^{:144–147}$ with its capital located near Brantas River estuarine, somewhere around modern Surabaya, Sidoarjo or Pasuruan in East Java.