Pangeran Pekik was born into the ruling house of the Duchy of Surabaya. His father, Jayalengkara, was the Duke of Surabaya at the time of Surabaya's conquest by Mataram. The House of Surabaya claimed to be descendants of Sunan Ampel, one of the nine saints credited with the spread of Islam in Java. However, deGraaf wrote that there was no evidence for this claim although he considered it likely that the ruling family were distantly related to Sunan Ampel.
Biography
Fall of Surabaya
At the time of Mataram's campaign of conquest against Surabaya, Pekik's father the duke was already blind and aged. Pekik was one of the leader of the defending forces and mobilised Surabaya's allies against Mataram. After several years of war, Surabaya surrendered in 1625. Pangeran Pekik was exiled to an ascetic life at the grave of Sunan Ngampel-Denta near Surabaya.
Move to Mataram court
In 1633, Mataram's Sultan Agung recalled Pangeran Pekik from Ampel. Pekik married Agung's sister and henceforth lived at court, while Agung's son and heir married Pekik's daughter. While at court, he "did much to civilize the Court" of Mataram, according to Dutch historian H. J. de Graaf. He brought culture from the court of Surabaya, which had been a centre of culture and Islamic Old Javanese literature since the second half of the 16th century, to the relatively new court of Mataram. Agung's decision to institute the Javanese calendar was probably the result of Pekik's influence.
Campaign against Giri
In 1636, Pekik was ordered by Sultan Agung to lead a Mataram army in a reconquest of Giri. Giri was a religious site, ruled by religious men who traced their lineage to Sunan Giri, one of the nine wali credited with spreading Islam in Java, and became a centre of opposition against Mataram. Agung hesitated to attack it, and he might have been worried that his men would not be willing to fight the holy men of Giri. Pekik's standing and his family's relation to the line of Sunan Ampel, a more senior wali than Sunan Giri, provided legitimacy to this campaign and help ensure the soldiers' loyalty. The fortified town of Giri was taken by Mataram troops under Pekik in 1636.
Amangkurat I's reign and assassination
Sultan Agung died in 1646 and was succeeded by Amangkurat I, who was married to one of Pekik's daughters. Around 1649, she died soon after giving birth to her third child, who was designated the crown prince. In 1659 Amangkurat I suspected that Pangeran Pekik was leading a conspiracy against his life. Subsequently, Pekik and his relatives, including those living in Surabaya, were killed under Amangkurat I's order. The massacre of Pekik's family, East Java's most important princely house, created a rift between Amangkurat and his East Javanese subjects. It also caused a conflict with his son, the crown prince, who was close to Pekik and the rest of his mother's family.