Direct VOC presence in Java started upon their capture of Jayakarta (now Jakarta, then Batavia) on 1619. In the 18th century, a massacre of ethnic Chinese in Batavia triggered a war between VOC and Mataram, resulting in the latter's defeat and cession of the north coast of Java, including Demak, to VOC.[8] Upon the latter's dissolution on late 1799, administration of the area along with the rest of VOC's territory was transferred to the Dutch Government while Mataram was reduced to several fragmented states in the south coast of Java, including Yogyakarta and Surakarta.