Diponegoro was born on 11 November 1785 in Yogyakarta, and was the eldest son of Sultan Hamengkubuwono III of Yogyakarta. During his youth at the Yogyakartan court, major occurrences such as the dissolution of the VOC, the British invasion of Java, and subsequent return to Dutch rule took place. During the invasion, the Sultan Hamengkubuwono II, pushed aside in his power on 1810 in favor of Diponegoro's father, used the general disruption to regain control. In 1812 however he was once more removed from the throne and exiled off-Java by the British forces. In this process, Diponegoro acted as an adviser to his father and had apparently provided aid to the British forces to the point where Raffles offered him the "Sultan" title which he declined, perhaps due to the fact that his father was still reigning.