[5] The campaign began in 1614 when Mataram, under the leadership of Sultan Agung, attacked Surabaya's allies, including Wirasaba.
Over the next few years, Mataram gradually conquered members of the Surabayan alliance, and by 1620, the city of Surabaya itself was under siege, holding out until it surrendered in 1625.
[6] Surabaya and other conquered areas would remain in Mataram's hands until it was ceded to the Dutch East India Company in 1743.
[7] In the latter half of the 16th century, the Sultanate of Demak, the dominant power on the island of Java, disintegrated into several independent states.
[5] It was a wealthy and powerful state,[5] and the city was an important port in the trade route between Malacca and the Spice Islands.
[5] Allied with the nearby state of Pasuruan, the Duchy expanded its influence throughout the eastern part of Java in the beginning of the 17th century.
He began the eastward conquest by an incursion towards Surabaya's southern flank, the Eastern Salient, Malang, and possibly Pasuruan in 1614.
[16][14] The conquest of the strategically important Wirasaba posed such a clear threat to Surabaya and other eastern states that the alliance rallied.
[16] This conquest put Agung in control of Tuban's shipbuilding activities, and therefore allowed him to build a navy to challenge Surabaya's previous naval supremacy.
[18] Instead, Mataram followed a pattern of attacking during the dry season, destroying crops and pillaging harvests from the areas surrounding Surabaya.
[20] The overland siege, and previous conquest of Surabaya's overseas allies, caused a lack of food and other supplies in the city.
[20] One faction, notably including the exiled Duke of Pajang, pushed for continued resistance, but other nobles convinced Jayalengkara to surrender.
[22] The conquest eliminated Mataram's strongest rival to the east and allowed Sultan Agung to establish his sovereignty over most of the Javanese-speaking population of Java, as well as Madura.
[2] The fighting, sickness, and starvation, and the disruption of agriculture, caused the deaths of many – the number is unknown, but estimated to be large.