page_title: Yogyakarta
section_title: Yogyakarta secedes and European invasions (1745–1830)
hierarchical_section_title: Yogyakarta / History / Yogyakarta secedes and European invasions (1745–1830)
caption_attribution_description: Main pavilion at the kraton of Yogyakarta, Indonesia
context_page_description: Yogyakarta is the capital city of Special Region of Yogyakarta in Indonesia, on the island of Java. As the only Indonesian royal city still ruled by a monarchy, Yogyakarta is regarded as an important centre for classical Javanese fine arts and culture such as ballet, batik textiles, drama, literature, music, poetry, silversmithing, visual arts, and wayang puppetry. Renowned as a centre of Indonesian education, Yogyakarta is home to a large student population and dozens of schools and universities, including Gadjah Mada University, the country's largest institute of higher education and one of its most prestigious.
  Yogyakarta is the capital of the Yogyakarta Sultanate and served as the Indonesian capital from 1946 to 1948 during the Indonesian National Revolution, with Gedung Agung as the president's office. One of the districts in southeastern Yogyakarta, Kotagede, was the capital of the Mataram Sultanate between 1587 and 1613.
  The city's population was 422,732 inhabitants at the 2017 census. Its built-up area was home to 4,010,436 inhabitants, which includes Magelang and 65 districts across Sleman, Klaten, Bantul, Kulon Progo, and Magelang regencies.
context_section_description: A civil war in the Mataram Sultanate broke out between Pakubuwono II (1745–1749), the last ruler of Kartasura, and his younger brother and heir apparent to the throne, Prince Mangkubumi (later known as Hamengkubuwono I, the first Sultan of Yogyakarta, and the founder of the current ruling royal house). Pakubuwono II had agreed to cooperate with the Dutch East India Company, and ceded some Mataram territory to the Dutch. His younger brother, Prince Mangkubumi, stood against the agreement, citing concerns that the people would become slaves under Dutch rule. During the war, Prince Mangkubumi defeated Pakubuwono II's forces and declared sovereignty in the Sultanate of Yogyakarta, occupying the southern parts of the former Mataram Sultanate.
  With Pakubowono II dead from illness, the Yogyakarta Sultanate was established as a result of the Treaty of Giyanti (Perjanjian Gianti), signed and ratified on 13 February 1755 among Prince Mangkubumi, the Dutch East India Company, and his nephew Pakubuwono III and his allies. Ascending to the newly-created Yogyakarta throne with the name Sultan Hamengkubuwono I, Mangkubumi thus established the royal House of Hamengkubuwono, still the ruling house of Yogyakarta today. Sultan Hamengkubuwono I and his family officially moved into the Palace of Yogyakarta, still the seat of the reigning sultan, on 7 October 1756. These events consequently marked the end of the Mataram Sultanate, resulting in the births of the rival Yogyakarta Sultanate and the Surakarta Sunanate.
  During the British occupation of Java in 1811, rumours of plans by the Yogyakarta court to stage a rebellion caused uneasiness among the colonial authorities. On 20 June 1812, Stamford Raffles led a 1,200-strong British force to attack the royal city. The Javanese, surprised by the attack, were easily subdued; Yogyakarta fell in one day, with the city destroyed and its palace looted. The event completely stripped the Sultanate of its remaining power and influence. The sack also left the court humiliated and ultimately fuelled a rebellion against the Dutch, which would be known as the Java War (1825–1830).
caption: The Yogyakarta sultanate palace's main pavilion
exif: {}