The Portuguese writer Tomé Pires mentioned that a Muslim lord was in power in Surabaya in 1513 though likely a vassal of the Hindu–Buddhist Majapahit.
[7] Javanese historians said that a holy man, a descendant of Sunan Giri, convinced the opposing sides to return without a battle.
More doubtful reports said it might have also extended its influence to Pasuruan and Blambangan (both in the eastern salient of Java), the Brantas valley region, and Wirasaba.
[11] Surabaya formed and led an alliance of eastern Javanese principalities, primarily in response to the growing power of Mataram.
[12][13] Other than Surabaya and its subordinate areas, the alliance also included Tuban, Malang, Kediri, Lasem, all in eastern Java, as well as Madura off the northern coast.
[11] As both Mataram and Surabaya expanded their territories and influence, they began to compete for hegemony in east and central Java.
[15][11] Dutch writers reporting from the trading post of Gresik wrote of the frequent Mataram–Surabaya conflicts in the early 17th century.
Because of a combination of geographic, logistical, and climatic factors, Mataram was not able to launch a direct assault on Surabaya,[19] or maintain a continued siege on the city.
[20] Instead, Mataram periodically attacked Surabaya during the dry seasons, laying sieges, destroying crops, and pillaging harvests from the surrounding areas.
[26] Most other port towns on the northeastern coast of Java, such as Demak and Tuban, were allied with Surabaya before they fell under Mataram control.
[1] The dukes of Surabaya claimed to be descendants of Sunan Ampel (1401–1481), one of the nine saints (wali songo) credited with the spread of Islam in Java.
[9][1][15] However, de Graaf wrote that there was no evidence for this claim although he considered it likely that the ruling family were distantly related to Sunan Ampel.