Kingdom of Pajang
The Kingdom of Pajang (1568–1586) was a short-lived Muslim state in Java. It was established by Hadiwijaya or Jaka Tingkir, Lord of Boyolali, after a civil war and was a successor to Sultanate of Demak. Hadiwijaya claimed to be a descendant of Brawijaya V, the last king of the Majapahit empire, and Trenggana, the sultan of Demak.
• Hadiwijaya assumes throne
• transfer of power to Mataram
In the last battle against the last claimant of Demak, the vicious Arya Penangsang, Jaka Tingkir commissioned his greatest vassal, Ki Ageng Pamanahan, and his son, Sutawijaya, to destroy Arya Penangsang's army. The two managed to defeat and kill Arya Penangsang and were thus awarded a fief in a forest called Alas Mentaok, now Kotagede, on which they founded their base for the future capital of Mataram Kingdom.
Legend says King Hadiwijaya was so fond of Sutawijaya, he adopted him as the playmate of his heir, Prince Banawa. Hadiwijaya's rule was supposed to be succeeded by this weak-minded heir, but a rebellion by a vassal named Ario Pangiri forced the prince to seek asylum from his childhood friend Sutawijaya.
Pledged to help, Sutawijaya gathered his army and defeated Ario Pangiri and seized the Pajang Palace. Prince Banawa then submitted his crown to Sutawijaya and thus ended the Kingdom of Pajang in 1586, when Sutawijaya founded the greatest Islamic kingdom in Java: Mataram Sultanate.