Pajang was region of former Majapahit kingdom. Jaka Tingkir, son of Kebo Kenanga or Ki Ageng Pengging. Ki Ageng Pengging was the regent of Pengging. After civil war in Demak, Jaka Tingkir became the third party to bridge the conflict. After the death of Parwoto and Kalinyamat, Jaka Tingkir asked KI Ageng Panjawi, Ki Ageng Pemanahan, Ngabei Loring Pasar, Juru Martani to attack Arya Penangsang. After the victory, Demak authority was moved to pajang and led by Jaka Tingkir or Hadiwijaya. Ki Agend Pengging was awarded to rule in Jepara and Ki Ageng Pemanahan was awarded to rule in Mataram. Ki Ageng Pemanahan died in 1575 and his land was inherited to his son, Sutawijaya or Ngabehi Loring Pasar. Sultan Pajang had given autonomy to Mataram with condition that annuly Matarm should bring tribute to Pajang.
Fortress construction was executed by Mataram as ordered by Sutawijaya. As he was busy with the construction, he forgot to go to Pajang and gave tribute. Sutawijaya was actually reluctant to obey Pajang but he still feared of Hadiwijaya. Ki Juru Martani asked Sutawijaya to make formal appearance to Pajang, but Sutawijara ignored it, he even ordered Mataram people to intercept people from Kedu and Bagelan brought tribute to Pajang. Sutawijae accepted the tribute and letting them had party. Hearing this, Hadiwijaya was angry and sent Ki Wilamarta and Wuragil to call Sutawijaya and message Sutawijaya to stop drinking, stop the party and cut his hair. Sutawijaya answered the messenger to tell Sultan pajang that he loved eating and drinking and about order to cut his hair that his hair grows naturally, and he would make formal appearance at pajang. Hadiwijaya was upset, and got him an idea to attack Mataram. ON the other side, Raden Pabelan, the son of Mayang regent was caught in an adultry with a princess. He was punished dead and then thrown away to Semarang. Hearing this, Sutawijaya could not accept that his brother in law punished. Sutawijaya sent his troops to intercept Raden Pabelan.
Hadiwijaya was angry and decided to war. Mataram would be attacked by pajang in 1582. But Pajang troop led by Hadiwijaya was tailed by Sutawijaya and his troop. The troop then destroyed. Hadiwijaya passed away of an illness. Hadiwijaya had a son, Benowo from his harem, Trenggana daughter, and a daughter married by Demak regent.
As suggested by Sunan Kudus, Demak regent got the throne while Benowo became Jipang regent. Benowo felt that he was treated unfairly, that he asked Sutawijaya’s help to attack Demak regent to gain Pajang throne. Sutawijaya agreed and they agreement was giving the right of Benowo to Sutawijaya. Finally Demak regent could be defeated and returned to Demak. Pajang was in power vacuum, Sutawijaya could not stay in pajang as he had his own palace in Mataram.
At last pajang was left and abandoned, Benowo became the ministerial of Sutawijaya. Sutawijaya became the sultan of Mataram. Mataram was free and became independent in 1586 with title Senopti Ing alaga Saidin Panatagama or popular as Penembahan Senopati. That was the end of pajang and Mataram Istam began.