In the midst of the Mangkubumi rebellion in 1749, Pakubuwana II fell ill and asked Johan Andries, Baron Van Hohendorff to assume control over the kingdom. Van Hohendorff requested written confirmation. On 11 December 1749, Pakubuwana II signed an agreement in which the "sovereignty" of Mataram was given to the Dutch East India Company. They installed a powerless puppet,
Pakubuwana III, on the throne. Mangkubumi, who considered himself to be the rightful heir to the throne, demanded the title of ruler. The people of
Mataram, who called him Hamengkubuwono, regarded him as the true ruler of Mataram. After years of battles including at
Grobogan and
Demak, the Dutch under de Clerck suffered a crushing defeat at the Bogowonto River. Governor-General Mossel entered peace negotiations with Hamengkubuwono. Eventually in 1755 the
Treaty of Giyanti was concluded, named after the place east of Surakarta where the negotiations took place. The Kingdom of Mataram was divided between the two warring parties. The old capital of Kartasura, which after years of fratricidal war had come to be thought of as doom-laden, was abandoned. Pakubuwana III became ruler of the eastern part of Mataram [(Kasoenanan Solo or Surakarta) (1750–1788)], and built a new
kraton in Surakarta. Hamengkubuwono became Sultan Hamengkubuwono I, reigning over the western half of Mataram, and north of Kartasura built his new kraton at
Yogyakarta (Kasultanan Yogyakarta) (1755–1792). He also gave Mas Said a south-eastern part of Mataram as the 'princely state' of Mangkunegara (1757–1796), where he ruled as Mangkunegara I and built his own kraton near Surakarta. ==References==