The Mataram conquest of Surabaya or Mataram-Surabaya War was a military campaign by the Sultanate of Mataram in the early 17th century that resulted in the capture of the Duchy of Surabaya  and its allies in eastern Java, in modern-day Indonesia. Prior to this conquest, Mataram and Surabaya were rivals for power in central and eastern Java. The campaign began in 1614 when Mataram, under the leadership of Sultan Agung, attacked Surabaya's allies, including Wirasaba. Surabaya and its allies launched a counterattack but were defeated near Pajang in 1616. 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. With this conquest, Mataram unified most of central and eastern Java under its control, and cemented its position as the dominant power in Java. Surabaya and other conquered areas would remain in Mataram's hands until it was ceded to the Dutch East India Company in 1743.. How many areas of Java were Mataram and Surabaya rivals for power?