[1] Born Danang Sutawijaya, known as Dananjaya, he was the son of Ki Ageng Pamanahan, a Javanese chief and retainer to Joko Tingkir, who reigned as Hadiwijaya, Sultan of Pajang.
Sutawijaya's mother was Nyai Sabinah who, according to Javanese chronicles, was a descendant of Sunan Giri, a member of Walisanga.
Nyai Sabinah had a brother, Ki Juru Martani, who was elected as the first patih (viceregent) of Mataram.
Hadiwijaya gave him a residence in the north of a market, thus his nickname "Raden Ngabehi Loring Pasar".
[citation needed] According to Javanese tradition, the Senopati who was Joko Tingkir's foster son assassinated Arya Penangsang of Jipang-Panolan (now in Cepu, Blora Regency), making him the last direct heir of the Sultans of Demak.
After he died in 1575, Sutawijaya succeeded him as chief of Mataram, styled Senapati Ing Ngalaga (meaning "commander in the battlefield").
The traditional chronicle Babad Tanah Jawi alleges that Senopati, in his quest to become the supreme ruler of Java, had a spiritual alliance with Nyai Roro Kidul, the Javanese goddess of the Indian Ocean.
The Babad, however, derives Senopati's support from Muslim saint Sunan Kalijaga, who is considered to be one of the Wali Songo or 'Nine Apostles' of Islam in Java.
He then sent 3 messengers to investigate Mataram's development, i.e. Arya Pamalad of Tuban, Prince Benawa, and Patih Mancanegara.
Raden Pabelan himself was sentenced to death and his corpse was thrown away to Jenes River in Laweyan (currently located in Surakarta).
On his deathbed, Sultan Hadiwijaya requested his children not to dislike Senapati and they had to treat him as the eldest brother.
Supported by Panembahan Kudus, he occupied Pajang in 1583 and ousted Prince Benawa by appointing him as Duke of Jipang.
Pajang then became Mataram's vassal state, administered by Prince Gagak Baning, Senapati's brother.
Senopati's reliance upon both Sunan Kalijaga and Nyai Loro Kidul in the chronicles' accounts nicely reflects the Mataram Dynasty's ambivalence towards Islam and indigenous Javanese beliefs.
The straight line between Mount Merapi at the north and the southern sea, with the Mataram kingdom at the center, was a strong concept of cosmology among the Javanese.
In 1595, the Duke of Pasuruan intended to submit to Mataram peacefully, but was prevented by his commander, Rangga Kaniten.