Riau allegedly has been inhabited since the period between 10,000–40.000 BC. Between 5th to 12th century AD, traders and merchants from the Indian subcontinent visited the region to trade with the local people, spreading Hinduism and Buddhism in the process. Therefore, Riau was under the control of several Hindu-Buddhist kingdoms such as the Melayu Kingdom and the Srivijaya empire. In the 14th century, Muslim traders from India and the Arabian Peninsula visited the region, beginning the spread of Islam in the region. By the end of the 14th century, Hindu and Buddhist influence are waning, while Islam influence are growing, leading to the dissolution of many Hindu-Buddhist Kingdoms in Riau. Those kingdoms who still existed transformed itself into an Islamic Sultanates. By the 16th century, there are three great Malay sultanates in the region, namely the Siak Sri Indrapura Sultanate, Indragiri Sultanates and the Johor Sultanate, the latter which would split in the 19th century into the modern Johor Sultanate in the Malay peninsula and the Riau-Lingga Sultanate in the Riau Archipelago. However, by that time Europeans began frequenting the region. first the Portuguese, then the Dutch and the British. In 1824, the Dutch and British agreed to divide the sphere of influence in the region, with the Malay peninsula falling under the British and Sumatra falling under the Dutch. Soon afterwards, the power of the sultanates in the region began to wane. The sultanates soon became protectorate of the Dutch and was reduced to nothing but a puppet states of the Dutch East Indies, with the Dutch having the authority to intervene in the everydays affair. This happens until 1942, when the Japanese invaded and occupied Riau during the Pacific theater of World War II. After three years of occupation which was marked by atrocities and war crimes, the Japanese surrendered in 1945. The Dutch soon returned to assume control of the region, but left in 1949 after the Dutch–Indonesian Round Table Conference, in which the Dutch agreed to transfer sovereignty of the Dutch East Indies to the Republic of Indonesia. Since then, Riau has been part of the unitary state of Indonesia.