and Pasuruan, southeast of Surabaya, was taken in 1617. Tuban, one of the oldest and largest port cities on the coast of Java, was taken in 1619. Surabaya was Mataram's most difficult enemy. Senapati was not strong enough to attack this powerful city and Anyokrowati attacked it to no avail. Sultan Agung tried to weakened Surabaya by launching a naval campaign across Java Sea and capturing Sukadana, Surabaya's ally in southwest Kalimantan in 1622, and the island of Madura, another ally of Surabaya, was taken in 1624 after a fierce battle. Soon Madura's fortifications in Sumenep and Pamekasan fell, Agung installed Adipati of Sampang as the Adipati of Madura, stylised as Prince Cakraningrat I. After five years of war, Agung finally conquered Surabaya in 1625. The city was taken not through outright military invasion, but instead through a siege; Agung installed a tight blockade from the land and sea, starving Surabaya into submission. With Surabaya brought into the empire, the Mataram kingdom encompassed all of central and eastern Java, also Madura and Sukadana on southwest Borneo, except for the west and east end of the island and its mountainous south (except for Mataram — of course). Sultan Agung consolidated his political unity by forging marriage alliance of his Adipati to the Princesses of Mataram. Agung himself took the hand of Cirebon Princess as his consort, in an effort to sealed Cirebon as Mataram's loyal ally. By 1625, Mataram was undisputed ruler of Java. Such a mighty feat of arms, however, did not deter Mataram's former overlords from rebellion. Pajang rebelled in 1617, and Pati rebelled in 1627. After the capture of Surabaya in 1625, expansion stopped while the empire was busied by rebellions. Batavia campaign and western conquests Along western Java, Banten and the Dutch settlement in Batavia remained outside of Agung's control. In his effort to unite Java, Agung claimed Mataram as the successor state of Demak, which historically held Banten as a vassal state. However, the Banten Sultanate opposed Agung's claim, preferring to remain as a sovereign state. Agung therefore considered military conquest as a means to coerce Banten into Mataram's hegemony. However, if Agung were march his armies to Banten, the port city of Batavia would stand as a potential opponent too near to the proximity of the Banten region. This did not deter Agung from pursuing his claim as he already perceived Dutch rule of Batavia