By the reign of Sultan Agung of Mataram, most of the older Hindu-Buddhist kingdoms of Indonesia, had at least nominally converted to Islam. The last one to do so was Makassar in 1605. After the fall of Majapahit empire, Bali became the refuge for the Hindu upper class, Brahmins and their followers that fled from Java, thus transferring the Hindu culture of Java to Bali.[6][7][4] Hinduism and Buddhism remained extant in some areas of East Java where it syncretized with animism.