Early Acehnese history indicates that it was once ruled by Buddhists who were originally from India. The Sunni Islam religion came to the region probably in the twelfth century, and perhaps earlier. The Acehnese had their first sultan, who controlled a harbor, in the sixteenth century, but it was not until the seventeenth century that the entire area was politically united as a sultanate. The Acehnese resisted colonial European power, which appeared in approximately 1509 and which became prevalent under the Dutch by 1601. The Acehnese did not surrender officially to the Dutch until 1903, and even then resistance continued until World War I. Although declared a part of the new state of Indonesia in 1945, the Acehnese effectively ruled themselves until 1961.