Amangkurat I of Mataram

[citation needed] The death of Sultan Agung of Mataram was unexpected, and there was a risk of succession disputes and chaos.

[1] He tightened his control over administration, appointing syahbandars under his influence to counter the power of local orangkayas (nobility) especially in the north city ports.

Upon taking the throne, he tried to bring long-term stability to the sultanate's realm, which was considerable in size but marred by continual rebellions.

He murdered local leaders that he deemed insufficiently deferential to him, including the still-powerful noble from Surabaya, Pangeran Pekik,[3] his father-in-law.

[4] Amangkurat also ordered the closing of ports[5] and destroyed ships in coastal cities to prevent them from getting too powerful from their wealth.

[6] Amangkurat I established a close relationship with the Dutch East India Company (VOC) who had previously fought with his father.

[citation needed] The crown prince felt that his life was not safe in the court after he took his father's concubine, Rara Oyi, with the help of his maternal grandfather, Pangeran Pekik of Surabaya, making Amangkurat suspicious of a conspiracy among the Surabayan factions to grab power in the capital by using Pekiks’ grandson's powerful position as the crown prince.

Amangkurat sentenced his father-in-law, Pangeran Pekik, to death, on the charge of abducting Rara Oyi for the crown prince.

[citation needed] By the mid-1670s dissatisfaction with the king was turning into open revolt, beginning from the recalcitrant Eastern Java and creeping inward.

[7] Raden Trunajaya, a prince from Madura, led the Trunajaya rebellion supported by itinerant fighters from faraway Makassar, led by Karaeng Galesong (supporter of Sultan Hasanuddin who had been defeated by Dutch East India Company in 1668), that captured the king's court at Mataram in mid-1677.

Seizing this opportunity, Puger assumed the throne in the ruins of Plered with the title Susuhunan ing Alaga.

Amangkurat also made a will to his son to ask for help from the Dutch East India Company to seize the throne from Trunajaya.