Dharmawangsa (also spelled Dharmavamsa), stylized regnal name Sri Maharaja Isyana Dharmawangsa Teguh Anantawikramottunggadewa of Isyana dynasty was the last raja of the Kingdom of Medang reigned from 990-1016 CE. He also known in his posthumous name Wijayamreta Wardhana which means "powerful in glorious death", which refer to his fight to the death.
He succeeded Sri Makutawangsa Wardhana. Dharmawangsa was the patron of the translator of the Mahabharata text into Old Javanese. Dharmawangsa was either the son or son-in-law of Sri Makutawangsawardhana, preceding King of Medang and grandson of Mpu Sindok.
Dharmawangsa conquered several areas, including Bali, and established a colony in West Kalimantan. Dharmawangsa's sister, Princess Mahendradatta, married Udayana, Raja of the Warmadewa Dynasty in Bali, and had a son, Airlangga.
In the year 990, Dharmawangsa launched a naval invasion on Sriwijaya in Sumatra and unsuccessfully attempted to capture Palembang, as Sriwijaya repelled the invaders. Dharmawangsa's invasion is mentioned by both ambassadors to China in 992.
In 1016, Srivijaya launched a retaliation attack and destroyed the Watugaluh Palace in Java. Srivijaya forces assisted the lesser king Haji (king) Wurawari of Lwaram to revolt, attacked and destroyed the Medang Palace, killing Dharmawangsa and most of the royal family.:130 This sudden and unexpected attack took place during the wedding ceremony of Dharmawangsa's daughter, which rendered the court unprepared and shocked. Dharmawangsa follows kshatriya code of honor, valiantly defend his court to his death. For this he was honored in his posthumous name Wijayamreta Wardhana which means "powerful (king) in glorious death".
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 Srivijaya, the kingdom finally collapsed and fell to chaos. There was further unrest and violence several years after the kingdom's demise.:130
Dharmawangsa's heir and nephew, Airlangga, son of Mahendradatta and Udayana, was aged only 16 at the time. However, he escaped the invaders and went on to become founder of the Kahuripan Kingdom, successor of the Medang Kingdom.:144
| Monarch of Medang Kingdom
991 – 1016