Because of its favourable situation on the Balinese Sea and its navigable river, Surabaya was one of the most important ports on the north coast. It was the only state that continued for years to offer resistance to the king of Mataram, who conquered all the coastal territories in the course of his campaigns. Eventually Surabaya also succumbed to Mataram until it fell under VOC control in 1743. It then became the seat of the official in charge of the north-eastern coast of Java.