information:extraction, quality:corruption
War against Java

In the 10th century, the rivalry between Sumatran Srivijaya and the Javanese Mataram kingdom became more intense and hostile. The animosity was probably caused by Srivijaya's effort to reclaim the Sailendra lands in Java or by Mataram's aspiration to challenge Srivijaya domination in the region. In East Java, the Anjukladang inscription dated 937 mentions an infiltration attack from Malayu — which refers to a Srivijayan attack upon the Mataram Kingdom of East Java. The villagers of Anjuk Ladang were awarded for their service and merit in assisting the king's army, under the leadership of Mpu Sindok, in repelling invading Malayu (Sumatra) forces; subsequently, a jayastambha (victory monument) was erected in their honor.

In 990, King Dharmawangsa of Java launched a naval invasion against Srivijaya and attempted to capture the capital Palembang. The news of the Javanese invasion of Srivijaya was recorded in Chinese Song period sources. In 988, a Srivijayan envoy was sent to the Chinese court in Guangzhou. After sojourning for about two years in China, the envoy learned that his country had been attacked by Java which made him unable to return home. In 992 an envoy from Java arrived in the Chinese court and explained that their country was involved in continuous war with Srivijaya. 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 country. The Srivijayan envoy then sailed back to China and appealed to the Chinese Emperor for the protection of Srivijaya against Javanese invaders.

Dharmawangsa's invasion led the Maharaja of Srivijaya, Sri Cudamani Warmadewa, to seek protection from China. Warmadewa was known as an able and astute ruler, with shrewd diplomatic skills. In the midst of the crisis brought by the Javanese invasion, he secured Chinese political support by appeasing the Chinese Emperor. In 1003, a Song historical record reported that the envoy of San-fo-qi was dispatched by the king Shi-li-zhu-luo-wu-ni-fo-ma-tiao-hua (Sri Cudamani Warmadewa). The Srivijayan envoy told the Chinese court that in their country a Buddhist temple had been erected to pray for the long life of Chinese Emperor, and asked the emperor to give the name and the bell for this temple which was built in his honor. Rejoiced, the Chinese 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.

In 1006, Srivijaya's alliance proved its resilience by successfully repelling the Javanese invasion. This attack opened the eyes of Srivijayan Maharaja to the threat of the Javanese Mataram Kingdom, so he laid a plan to destroy his Javanese rival. Srivijaya assisted Haji (king) Wurawari of Lwaram to revolt, which led to the attack and destruction of the Mataram palace. This sudden and unexpected attack took place during the wedding ceremony of Dharmawangsa's daughter, which left the court unprepared and shocked. With the death of Dharmawangsa and the fall of the Mataram capital, Srivijaya contributed to the collapse of Mataram kingdom, leaving Eastern Java in further unrest, violence and, ultimately, desolation for several years to come.