The Yogyakarta Palace was founded by Sultan Hamengku Buwono I several months after the Giyanti Treaty in 1755. The palace's location is said to have been a former rest house called Garjitawati. This rest house was used as a resting place for the funeral processions of the kings of Mataram (Kartasura and Surakarta) who were to be buried in Imogiri. Another version states that the palace's location was a spring, Umbul Pacethokan, located in the middle of the Beringan forest. Before moving into the Yogyakarta Palace, Sultan Hamengku Buwono I resided at the Ambar Ketawang Rest House, which is now part of the Gamping District, Sleman Regency.