The king of Mataram ruled over his kingdom from the palace in Djokjakarta. Through his conquest of the coastal territories in the 17th century, he controlled virtually all of Java. However, internal divisions and the increasing power of the Company weakened the king's position. He became increasingly dependent on the VOC, which provided the king with military and financial support against his rebellious vassals. In 1743 the king ceded his kingdom to the Company, which thus became the unchallenged ruler of Java.