Amangkurat II secured his reign with the defeat of the rebels.
Due to rebel capture and subsequent destruction of the capital in Plered, he built a new capital, Kartasura, in the district of Pajang, and moved his court there.
A VOC fort was constructed in the capital, next to the royal residence, to defend it against invasion.
As for the VOC, its involvement allowed the cornered and nearly defeated Amangkurat II to stay on his throne.
This began the precedent of the VOC supporting Javanese kings or claimants in exchange for concessions.
However, in 1680 this policy required a high level of expenditure to maintain a military presence in Central and East Java, and this contributed to the VOC's financial decline.
The payments promised by Amangkurat were not made, and by 1682 the king's debt to the VOC exceeded 1.5 million reals, about five times the amount of the royal treasury.
The cession of Semarang was delayed by disputes, and other stipulations in the contract were largely ignored by local Javanese officials.
Furthermore, an anti-VOC faction developed at the Mataram court, and a member of this faction, Nerangkusuma, became the patih (chief minister) from 1682 to 1686.
Poor relations between Mataram and the VOC continued with the sheltering of Surapati, an enemy of the VOC, in 1684, and the death of VOC captain François Tack in the Mataram court in 1686.

The king's brother Pangeran Puger, who tried to claim the throne during the Trunajaya rebellion, was pardoned by the king.
However, after the king's death in 1703 and the accession of his son Amangkurat III, Puger claimed the throne again.
Puger's claim was supported by the VOC, and the VOC–Puger alliance won the ensuing First Javanese War of Succession (1704–1708).
Puger took the throne with the title Pakubuwana I and Amangkurat III was exiled to Ceylon.
Amangkurat II secured his reign with the defeat of the rebels. Due to rebel capture and subsequent destruction of the capital in Plered, he built a new capital, Kartasura, in the district of Pajang, and moved his court there. A VOC fort was constructed in the capital, next to the royal residence, to defend it against invasion. As for the VOC, its involvement allowed the cornered and nearly defeated Amangkurat II to stay on his throne. This began the precedent of the VOC supporting Javanese kings or claimants in exchange for concessions. However, in 1680 this policy required a high level of expenditure to maintain a military presence in Central and East Java, and this contributed to the VOC's financial decline. The payments promised by Amangkurat were not made, and by 1682 the king's debt to the VOC exceeded 1.5 million reals, about five times the amount of the royal treasury. The cession of Semarang was delayed by disputes, and other stipulations in the contract were largely ignored by local Javanese officials. Furthermore, an anti-VOC faction developed at the Mataram court, and a member of this faction, Nerangkusuma, became the patih (chief minister) from 1682 to 1686. Poor relations between Mataram and the VOC continued with the sheltering of Surapati, an enemy of the VOC, in 1684, and the death of VOC captain François Tack in the Mataram court in 1686.
The king's brother Pangeran Puger, who tried to claim the throne during the Trunajaya rebellion, was pardoned by the king. However, after the king's death in 1703 and the accession of his son Amangkurat III, Puger claimed the throne again. Puger's claim was supported by the VOC, and the VOC–Puger alliance won the ensuing First Javanese War of Succession (1704–1708). Puger took the throne with the title Pakubuwana I and Amangkurat III was exiled to Ceylon.
Trunajaya rebellion