The adoption of Islam in the 14th century saw the rise of a number of powerful sultanates on the Malay Peninsula and island of Borneo. The Portuguese in the 16th century and the Dutch in the 17th century were the first European colonial powers to establish themselves on the Malay Peninsula and Southeast Asia. However, it was the British who ultimately secured their hegemony across the territory and during the late 18th and 19th centuries established colonies and protectorates in the area that is now Malaysia. These holdings were occupied by Japan from 1942 to 1945. In 1948, the British-ruled territories on the Malay Peninsula except Singapore formed the Federation of Malaya, which became independent in 1957. Malaysia was formed in 1963 when the former British colonies of Singapore, as well as Sabah and Sarawak on the northern coast of Borneo, joined the Federation. The first several years of the country's independence were marred by a communist insurgency, Indonesian confrontation with Malaysia, Philippine claims to Sabah, and Singapore's withdrawal in 1965. During the 22-year term of Prime Minister MAHATHIR Mohamad (1981-2003), Malaysia was successful in diversifying its economy from dependence on exports of raw materials to the development of manufacturing, services, and tourism. Prime Minister MAHATHIR and a newly-formed coalition of opposition parties defeated Prime Minister Mohamed NAJIB bin Abdul Razak's United Malays National Organization (UMNO) in May 2018, ending over 60 years of uninterrupted rule by UMNO. MAHATHIR resigned in February 2020 amid a political dispute. King ABDULLAH then selected Tan Sri MUHYIDDIN Yassin as the new prime minister.