The Mataram Sultanate was established in the year 1509 when Sultan Hadiwijaya, the ruler of the Sultanate of Pajang, gave away the Alas Mentaok (Mentaok forest) to Ki Gede Pemanahan for the latter’s service in helping conquer the enemies of Pajang.
Pemanahan and his family and followers then moved to the forest, which contained the remnants of the Mataram Hindu kingdom.
He also built a small village in the forest. When he passed away, his son Senopati Ingalaga – which later on was honored as Panembahan or His Majesty – took over the area. He then developed the village into a city called Kotagede, which literally means a big city.
Today, the remnants of the Mataram Sultanate were only a fort in Kotagede which comprises the Mataram kings’ grave and a grand mosque.
On certain nights of the Javanese lunar calendar, many people visit the royal graveyard and the mosque to pay respect and pray.