The Second Javanese War of Succession was a struggle between Sultan Amangkurat IV of Mataram supported by the Dutch East India Company (Dutch: Vereenigde Oost-Indische Compagnie; VOC) against the rebellion of rival Princes who contested his right for the throne.
In 1719, Pakubuwana I died and his son Amangkurat IV took the throne in 1719, but his brothers, Princes Blitar and Purbaya contested the succession. They attacked the palace in June 1719. When they were repulsed by the cannons in VOC’s fort, they retreated south to the land of Mataram. Their uncle, Prince Arya Mataram, ran to Japara and proclaim himself king, thus began the Second War of Succession. Before the year ended, Arya Mataram surrendered and was strangled in Japara by the Sultan’s order and Blitar and Purbaya were dislodged from their stronghold in Mataram in November. In 1720, these two princes ran away to the still rebellious interior of East Java. Luckily for VOC and the young king, the rebellious regents of Surabaya, Jangrana III and Jayapuspita died in 1718–20 and Prince Blitar died in 1721.
In May and June 1723, the remnants of the rebels and their leaders surrendered, including Surengrana of Surabaya, Princes Purbaya and Dipanagara, all of whom were banished to Ceylon, except Purbaya, who was taken to Batavia to serve as “backup” to replace Amangkurat IV in case of any disruption in the relationship between the king and VOC since Purbaya was seen to have equal “legitimacy” by VOC. It is obvious from these two Wars of Succession that even though VOC was virtually invincible in the field, mere military prowess was not sufficient to pacify Java.