During the 13th century Islam spread to the in northern Sumatra. More and more Indonesian areas gradually adopted Islam. By the end of the 16th century it was the dominant religion in Java and Sumatra. But it mixed with existing cultural and religious influences. 