Both Hinduism and Buddhism were well established in the Malay Peninsula by the beginning of the 1st century CE, and from there spread across the archipelago.