Yogyakarta is the capital of the Yogyakarta Special Region and was the Indonesian capital during the Indonesian National Revolution from 1945 to 1949, with Gedung Agung as the president's office. One of the districts in Yogyakarta, Kotagede, was the capital of the Mataram Sultanate between 1575 and 1640.
The city is named after the Indian city of Ayodhya from the Ramayana epic. Yogya means "suitable, fit, proper", and karta, "prosperous, flourishing" (i.e., "a city that is fit to prosper").
Its population was 388,627 inhabitants at the 2010 census and its built-up (or metro) area was home to 4,010,436 inhabitants across two cities (Yogyakarta and Magelang) and 65 districts across Sleman, Klaten, Bantul, Kulon Progo and Magelang regencies. Yogyakarta-Magelang and Surakarta are being agglomerated in several years.
Because of its urbanisation and modernisation, Yogyakarta has a very high HDI ranking nationally, being one of the highest in Indonesia as well; at 0.837 (or "very high"), on which it could be considered as a "developed" city.
According to Canggal inscription dated 732, the area traditionally known as "Mataram" became the capital of the Medang Kingdom, identified as Mdang i Bhumi Mataram established by King Sanjaya. Mataram became the center of a refined and sophisticated Javanese Hindu-Buddhist culture, for about three centuries its heartland in Kewu Plain (southern slope of Mount Merapi) around Prambanan witnessed the construction of numerous candi including Borobudur and Prambanan.
Around the year 929, the centre of the kingdom was shifted to East Java by Mpu Sindok, who established the Isyana Dynasty. The exact cause of the move is still uncertain; however, a severe eruption of Mount Merapi volcano or a power struggle probably caused the move. Historians suggest that, some time during the reign of King Wawa of Mataram (924929), Merapi volcano erupted and devastated the kingdom's capital in Mataram.
During the Majapahit era, the area surrounding modern Yogyakarta was identified again as "Mataram" and recognized as one of the twelve Majapahit provinces in Java ruled by a Duke titled 'Bhre Mataram'. During the reign of Hayam Wuruk (1350 to 1389), the title of Bhre Mataram was held by king's nephew and son in-law Wikramawardhana.
Kotagede (now a district of Yogyakarta) was established as the capital of the Mataram Sultanate. During the reign of Sultan Agung Hanyokrokusumo (1613-1645), the Sultanate Mataram reached its zenith as the greatest kingdom in Java, and expanded its influence to Central Java, East Java and half of West Java. After two changes of capital, (Palace of Pleret and Place of Kerta, both located in Bantul Regency), the capital of Mataram Sultanate moved to Kartasura.