The Treaty of Giyanti was signed and ratified on 13 February 1755 at Giyanti in central Java between Sunan (ruler) Pakubuwono III of Mataram , his uncle Prince Mangkubumi and VOC ( Dutch East India Company ). By this treaty, the western half of Mataram was granted to Mangkubumi. Pakubuwono guarded the eastern half and its capital Surakarta .

After the signing of the treaty, Mangkubumi took the title of Sultan Hamengkubuwono and set up his court in Yogyakarta , not far from Kota Gede , now a suburb of the city, where the tomb of Senopati, the founder of Mataram, is located.

This treaty did not put an end to the conflict then striking Mataram, called ” Third War of Javanese Succession “. Prince Said, another uncle of the Susuhunan , was in fact pursuing his rebellion against Pakubuwono.