was in financial difficulties during the period of 1683–1710. But the ability of the king to fulfil the terms of agreement depended largely on the stability of Java, for which the VOC has made a guarantee. It turned out later that the VOC's military might was incapable of such a huge task. The last years of Pakubuwana's reign, from 1717 to 1719, were dominated by rebellion in East Java against the kingdom and its foreign patrons. The murder of Jangrana II in 1706 incited his three brothers, regents of Surabaya, Jangrana III, Jayapuspita and Surengrana, to raise a rebellion with the help of Balinese mercenaries in 1717. Pakubuwana I's tributes to the VOC secured him a power which was feared by his subjects in Central Java, but this is for the first time since 1646 that Mataram was ruled by a king without any eastern connection. Surabaya had no reason to submit any more and thirst for vengeance made the brother regents openly contest Mataram's power in Eastern Java. Cakraningkrat III who ruled Madura after ousting the VOC's loyal ally Cakraningrat II, had every reason to side with his cousins this time. The VOC managed to capture Surabaya after a bloody war in 1718 and Madura was pacified when Cakraningrat III was killed in a fight on board of the VOC's ship in Surabaya in the same year though the Balinese mercenaries plundered eastern Madura and was repulsed by the VOC in the same year. However, similar to the situation after Trunajaya's uprising in 1675, the interior regencies in East Java (Ponorogo, Madiun, Magetan, Jogorogo) joined the rebellion en masse. Pakubuwana I sent his son, Pangeran Dipanagara (not to be confused with another prince with the same title who fought the Dutch in 1825–1830) to suppress the rebellion in the eastern interior but instead Dipanagara joined the rebel and assumed the messianic title of Panembahan Herucakra. In 1719, Pakubuwana I died and his son Amangkurat IV took the throne in 1719, but his brothers, Pangeran Blitar and Purbaya, contested the succession. They attacked the kraton in June 1719. When they were repulsed by the cannons in the VOC's fort, they retreated south to the land of Mataram. Another royal brother, Pangeran Arya Mataram, ran to Japara and proclaimed himself king, thus began the Second War of Succession. Before the year ended, Arya Mataram surrendered and was strangled in Japara by