Hamengkubuwono I, born Raden Mas Sujana (died 1792), was the first sultan of Yogyakarta.
Sujana, the Crown Prince, was known as Prince Mangkubumi prior to becoming sultan of Yogyakarta Sultanate. As a son of Sultan Sunan Prabu of Mataram Mataram ruler, and brother to Prince Heir Apparent Pakubuwono II of Surakarta a dispute arose concerning Succession to the Mataram throne. Prince Mangkubumi challenged brother Pakubuwono II who was aided by the Dutch East India Company seeking a more pliant VOC puppet as Central Javanese king. The war that eventuated was known as the Third Succession War in Mataram.
During the war Prince Mangkubumi was aided by legendary army commander Raden Mas Said who fought in an effective strategic manner. Mangkubumi won decisive battles at Grobogan, Demak and Bogowonto River. During the War in 1749, Pakubuwono II died and the Crown Prince Mangkubumi became Sultan. At the Battle of Bogowonto River in 1751, the Dutch Army under De Clerck was destroyed by Mangkubumi's forces. Said revolted in dispute with Prince Mangkubumi. The Succession War ended when the Giyanti Treaty of 1755 Giyanti Treaty, signed in Giyanti- an area east of Surakarta (capital of Mataram Empire). Said was still fighting his revolt since he was excluded from the treaty. He only agreed to cease hostility after the Dutch invited him to sign another treaty in Salatiga, which granted him Royal Appenages and the principal title of Mangkunegara.
According to the Giyanti Treaty, Mataram was firstly divided into two kingdoms, Surakarta with Pakubuwono III as ruler, and Yogyakarta Sultanate with Prince Mangkubumi as sultan with the title Sri Sultan Hamengkubuwono I Senopati Ing Ngalaga Sayidin Panatagama Kalifatulah. Yogyakarta became capital and a new palace was built with a water palace in the west of his grounds Taman Sari.