text:
History of Malaysia

Malaysia is a modern concept, created in the second half of the 20th century. However, contemporary Malaysia regards the entire history of Malaya and Borneo, spanning thousands of years back to prehistoric times, as its history.

The first evidence for archaic human occupation can be dated to at least 1.83 million years ago, while the earliest remnants of an anatomically modern human are c. 40,000 years old. The ancestors of the present-day population of Malaysia entered the area in multiple waves in prehistorical and historical times.

Hinduism and Buddhism from India and China dominated early regional history, reaching their peak from the 7th to the 13th centuries during the reign of the Sumatra-based Srivijaya civilisation. Islam made its initial presence in the Malay Peninsula as early as the 10th century, but it was during the 15th century that the religion firmly took root at least among the court elites, which saw the rise of several sultanates; the most prominent were the Sultanate of Malacca and the Sultanate of Brunei.

The Portuguese were the first European colonial power to establish themselves on the Malay Peninsula and Southeast Asia, capturing Malacca in 1511. This event led to the establishment of several sultanates such as Johor and Perak. Dutch hegemony over the Malay sultanates increased during the course of the 17th to 18th century, capturing Malacca in 1641 with the aid of Johor. In the 19th century, the English ultimately gained hegemony across the territory that is now Malaysia. The Anglo-Dutch Treaty of 1824 defined the boundaries between British Malaya and the Dutch East Indies (which became Indonesia), and the Anglo-Siamese Treaty of 1909 defined the boundaries between British Malaya and Siam (which became Thailand). The fourth phase of foreign influence was a wave of immigration of Chinese and Indian workers to meet the needs created by the colonial economy in the Malay Peninsula and Borneo.

The Japanese invasion during World War II ended British rule in Malaya. After the Empire of Japan was defeated by the Allies, the Malayan Union was established in 1946 and was reorganized as the Federation of Malaya in 1948. In the peninsula, the Malayan Communist Party (MCP) took up arms against the British and the tension led to the declaration of emergency rule from 1948 to 1960. A forceful military response to the communist insurgency, followed by the Baling Talks in 1955, led to Malayan Independence on August 31, 1957, through diplomatic negotiation with the British. On 16 September 1963, the Federation of Malaysia was formed; in August 1965, Singapore was expelled from the federation and became a separate independent country. A racial riot in 1969, brought about the imposition of emergency rule, the suspension of parliament and the proclamation of the Rukun Negara, a national philosophy promoting unity among citizens. The New Economic Policy (NEP) adopted in 1971 sought to eradicate poverty and restructure society to eliminate the identification of race with economic function.

Under Prime Minister Mahathir Mohamad, there was a period of rapid economic growth and urbanization in the country beginning in the 1980s; the previous economic policy was succeeded by the National Development Policy (NDP) from 1991 to 2000. The late 1990s Asian financial crisis impacted the country, nearly causing their currency, stock, and property markets to crash; however, they later recovered. Early in 2020, Malaysia underwent a political crisis. This period was marked by the COVID-19 pandemic, which caused political, health, social, and economic crises. The 2022 general election resulted in the first-ever hung parliament in the country's history and Anwar Ibrahim became Malaysia's prime minister on November 24, 2022.

Prehistory
Stone hand axes from early hominoids, probably Homo erectus, have been unearthed in Lenggong. They date back 1.83 million years, one of the oldest pieces of evidence of hominid habitation in Southeast Asia.

The earliest evidence of modern human habitation in Malaysia is the 40,000-year-old skull excavated from the Niah Caves in today's Sarawak. This is also one of the oldest modern human skulls in Southeast Asia. The first foragers visited the West Mouth of Niah Caves (located 110 km southwest of Miri) 40,000 years ago when Borneo was connected to the mainland of Southeast Asia. Mesolithic and Neolithic burial sites have also been found in the area. The area around the Niah Caves has been designated the Niah National Park.

A study of Asian genetics suggests the original humans in East Asia came from Southeast Asia. The oldest complete skeleton found in Malaysia is an 11,000-year-old Perak Man unearthed in 1991. The indigenous groups on the peninsula can be divided into three ethnicities: the Negritos, the Senoi, and the proto-Malays. The first inhabitants of the Malay Peninsula were most probably Negritos. These Mesolithic hunters were probably the ancestors of the Semang, an ethnic Negrito group. The Senoi appear to be a composite group, with approximately half of the maternal mitochondrial DNA lineages tracing back to the ancestors of the Semang and about half to later ancestral migrations from Indochina. Scholars suggest they are descendants of early Austroasiatic-speaking agriculturalists, who brought both their language and their technology to the southern part of the peninsula approximately 4,000 years ago. They united and coalesced with the indigenous population. The Proto Malays have a more diverse origin and had settled in Malaysia by 1000 BC as a result of Austronesian expansion. Although they show some connections with other inhabitants in Maritime Southeast Asia, some also have an ancestry in Indochina around the time of the Last Glacial Maximum about 20,000 years ago. Areas comprising what is now Malaysia participated in the Maritime Jade Road. The trading network existed for 3,000 years, between 2000 BC to 1000 AD.

Anthropologists support the notion that the Proto-Malays originated from what is today Yunnan, China. R.H von Geldern, J.H.C Kern, J.R Foster, J.R Logen, Slametmuljana and Asmah Haji Omar. A history of Malaya and her neighbours – Page 21 – by Francis Joseph Moorhead, published by Longmans of Malaysia, 1965 India and ancient Malaya (from the earliest times to circa A.D. 1400) – Page 3 – by D. Devahuti, Published by D. Moore for Eastern Universities Press, 1965 The making of modern Malaya: a history from earliest times to independence – Page 5 – by N. J. Ryan, Oxford University Press, 1965 The cultural heritage of Malaya – Page 2 – by N. J. Ryan published by Longman Malaysia, 1971 A history of Malaysia and Singapore – Page 5 – by N. J. Ryan published by Oxford University Press, 1976 "How the dominoes fell": Southeast Asia in perspective – Page 7 – by Mae H. Esterline, Hamilton Press, 1986 A design guide of public parks in Malaysia – Page 38 – by Jamil Abu Bakar published by Penerbit UTM, 2002, ISBN 983-52-0274-5, ISBN 978-983-52-0274-2 An introduction to the Malaysian legal system – Page 1 – by Min Aun Wu, Heinemann Educational Books (Asia), 1975 A short history of Malaysia – Page 22 – by Harry Miller published by F.A. Praeger, 1966 Malaya and its history – Page 14 – by Sir Richard Olaf Winstedt published by Hutchinson University Library, 1962 Southeast Asia, past & present – Page 10 – by D. R. SarDesai published by Westview Press, 1994 Malaya – Page 17 – by Norton Sydney Ginsburg, Chester F. Roberts published by University of Washington Press, 1958 Asia: a social study – Page 43 – by David Tulloch published by Angus and Robertson, 1969 Area handbook on Malaya University of Chicago, Chester F. Roberts, Bettyann Carner published by University of Chicago for the Human Relations Area Files, 1955 Thailand into the 80's – Page 12 – by Samnak Nāyok Ratthamontrī published by the Office of the Prime Minister, Kingdom of Thailand, 1979 Man in Malaya – Page 22 – by B. W. Hodder published by Greenwood Press, 1973 The modern anthropology of South-East Asia: an introduction, Volume 1 of The modern anthropology of South-East Asia, RoutledgeCurzon Research on Southeast Asia Series – Page 54 – by Victor T. King, William D. Wilder published by Routledge, 2003, ISBN 0-415-29751-6, ISBN 978-0-415-29751-6 Journal of the Malaysian Branch of the Royal Asiatic Society – Page 17 – by Royal Asiatic Society of Great Britain and Ireland. Malaysian Branch, Singapore, 1936 Malay and Indonesian leadership in perspective – Page 9 – by Ahmad Kamar 1984 The Malay peoples of Malaysia and their languages – Page 36 – by Asmah Haji Omar published by Dewan Bahasa dan Pustaka, Kementerian Pelajaran Malaysia, 1983 Encyclopedia of world cultures Volume 5 – Page 174 – by David Levinson – History – 1993 published by G.K. Hall, 1993 Indigenous peoples of Asia – Page 274 – by Robert Harrison Barnes, Andrew Gray, Benedict Kingsbury published by the Association for Asian Studies, 1995 Peoples of the Earth: Indonesia, Philippines and Malaysia edited by Edward Evan Evans-Pritchard published by Danbury Press, 1973 American anthropologist Vol 60 – Page 1228 – by American Anthropological Association, Anthropological Society of Washington (Washington, D.C.), American Ethnological Society, 1958 Encyclopaedia of Southeast Asia (set of 5 Vols.) – Page 4 – by Brajendra Kumar published by Akansha Publishing House, 2006, ISBN 81-8370-073-X, ISBN 978-81-8370-073-3 This was followed by an early-Holocene dispersal through the Malay Peninsula into the Malay Archipelago. Around 300 BC, they were pushed inland by the Deutero-Malays, an Iron Age or Bronze Age people descended partly from the Chams of Cambodia and Vietnam. The first group in the peninsula to use metal tools, the Deutero-Malays were the direct ancestors of today's Malaysian Malays and brought with them advanced farming techniques. The Malays remained politically fragmented throughout the Malay Archipelago, although a common culture and social structure were shared.

Early Hindu-Buddhist kingdoms

In the first millennium AD, Malay became the dominant ethnicity on the peninsula. The small early states that were established were greatly influenced by Indian culture, as was most of Southeast Asia. Indian influence in the region dates back to at least the 3rd century BC. South Indian culture was spread to Southeast Asia by the South Indian Pallava dynasty in the 4th and 5th centuries.

Trade with India and China
In ancient Indian literature, the term Suvarnadvipa (Golden Peninsula) is used in the Ramayana; some argue that this is a reference to the Malay Peninsula. The ancient Indian text Vayu Purana also mentions a place named Malayadvipa; this term may refer to Sumatra and the Malay Peninsula. The Malay Peninsula was shown on Ptolemy's map as the Golden Chersonese.

Trade relations with China and India were established in the 1st century BC. Shards of Chinese pottery have been found in Borneo dating from the 1st century following the southward expansion of the Han dynasty. In the early centuries of the first millennium, the people of the Malay Peninsula adopted the Indian religions of Hinduism and Buddhism, which had a major effect on the language and culture of those living in Malaysia. The Sanskrit writing system was used as early as the 4th century.

Early kingdoms (3rd–7th centuries)

There were as many as 30 Malay kingdoms in the 2nd and 3rd centuries, mainly based on the eastern side of the Malay Peninsula. Among the earliest kingdoms known to have been based in the Malay Peninsula was the ancient kingdom of Langkasuka, located in the northern Malay Peninsula and based somewhere on the east coast. It was closely tied to Funan in Cambodia, which also ruled parts of northern Malaysia until the 6th century. In the 5th century, the Kingdom of Pahang was mentioned in the Book of Song. Besides this, Chi Tu and Pan Pan were old polities believed to be located in the northeast of the peninsula.

Gangga Negara
Gangga Negara was a semi-legendary Hindu kingdom mentioned in the Malay Annals that covered present-day Beruas, Dinding and Manjung in the state of Perak, Malaysia with Raja Gangga Shah Johan as one of its kings. According to the legendary Hikayat Merong Mahawangsa, Gangga Negara was founded by Merong Mahawangsa's son Raja Ganji Sarjuna of Kedah, allegedly a descendant of Alexander the Great or by the Khmer royalty no later than the 2nd century.

Old Kedah
Ptolemy, a Greek geographer, had written about the Golden Chersonese, which indicated that trade with India and China had existed since the 1st century AD. During this time, coastal city-states that existed had a trade network which encompassed the southern part of the Indochinese Peninsula and the western part of the Malay Archipelago. These coastal cities had ongoing trade as well as tributary relations with China, at the same time being in constant contact with Indian traders. They seem to have shared a common indigenous culture.

Gradually, the rulers of the western part of the archipelago adopted Indian cultural and political models. Three inscriptions found in Palembang (South Sumatra) and on Bangka Island, written in the form of Malay and in alphabets derived from the Pallava script, are proof that the archipelago had adopted Indian models while maintaining their indigenous language and social system. These inscriptions reveal the existence of a Dapunta Hyang (lord) of Srivijaya who led an expedition against his enemies and who curses those who does not obey his law.

Being on the maritime trade route between China and South India, the Malay Peninsula was involved in this trade. The Bujang Valley, being strategically located at the northwest entrance of the Strait of Malacca as well as facing the Bay of Bengal, was continuously frequented by Chinese and south Indian traders. Such was proven by the discovery of trade ceramics, sculptures, inscriptions and monuments dated from the 5th to 14th century.

Srivijaya (7th–13th century)
Between the 7th and the 13th century, much of the Malay Peninsula was under the influence of Srivijaya. The site Prasasti Hujung Langit, which sat at the centre of Srivijaya's empire, is thought to be at a river mouth in eastern Sumatra, based near what is now Palembang, Indonesia. In the 7th century, a new port called Shilifoshi is mentioned, believed to be a Chinese rendering of Srivijaya. For over six centuries the Maharajahs of Srivijaya ruled a maritime empire that became the main power in the archipelago. The empire was based around trade, with local kings (dhatus or community leaders) that swore allegiance to a lord for mutual profit. In 1025, the Chola dynasty captured Palembang, the king, all his family members and his courtiers had their wealth taken away; by the end of the 12th century Srivijaya had been reduced to a kingdom, with their last ruler, Queen Sekerummong being conquered and overthrown in 1288. Majapahit, a subordinate to Srivijaya, soon dominated the region's political scene.

Relations with the Chola Empire

The relation between Srivijaya and the Chola Empire of south India was friendly during the reign of Raja Raja Chola I but during the reign of Rajendra Chola I the Chola Empire invaded Srivijaya cities (see Chola invasion of Srivijaya). In 1025 and 1026, Gangga Negara was attacked by Rajendra Chola I of the Chola Empire, the Tamil emperor who is now thought to have laid Kota Gelanggi to waste. Kedah (known as Kadaram in Tamil) was invaded by the Cholas in 1025. A second invasion was led by Virarajendra Chola of the Chola dynasty who conquered Kedah in the late 11th century. The senior Chola's successor, Vira Rajendra Chola, had to put down a Kedah rebellion to overthrow other invaders. The coming of the Chola reduced the majesty of Srivijaya, which had exerted influence over Kedah, Pattani and as far as Ligor. During the reign of Kulothunga Chola I, Chola overlordship was established over the Srivijaya province Kedah in the late 11th century. The expedition of the Chola Emperors had such a great impression on the Malay people of the medieval period that their name was mentioned in the corrupted form as Raja Chulan in the medieval Malay chronicle Sejarah Melaya. Even today, the Chola rule is remembered in Malaysia as many Malaysian princes have names ending with Cholan or Chulan, one such was the Raja of Perak called Raja Chulan.

Pattinapalai, a Tamil poem of the 2nd century AD, describes goods from Kedaram heaped in the broad streets of the Chola capital. The Buddhist kingdom of Ligor took control of Kedah shortly after. Its king Chandrabhanu used it as a base to attack Sri Lanka in the 11th century and ruled the northern parts, an event noted in a stone inscription in Nagapattinum in Tamil Nadu and the Sri Lankan chronicles, Mahavamsa.

Decline and breakup
At times, the Khmer Empire, the Siamese Kingdom, and the Chola Empire had tried to exert control over the smaller Malay states. The power of Srivijaya declined from the 12th century as the relationship between the capital and its vassals broke down. Wars with the Javanese caused it to request assistance from China, and wars with Indian states are also suspected. In the 11th century, the centre of power shifted to Malayu, a port possibly located further up the Sumatran coast near the Jambi River. The power of the Buddhist Maharajas was further undermined by the spread of Islam. Areas which were converted to Islam early, such as Aceh, broke away from Srivijaya's control. By the late 13th century, the Siamese kings of Sukhothai had brought most of Malaya under their rule. In the 14th century, the Hindu Majapahit Empire came into possession of the peninsula.

An excavation by Tom Harrisson in 1949 unearthed a series of Chinese ceramics at Santubong (near Kuching) that date to the Tang and Song dynasties. It is possible that Santubong was an important seaport in Sarawak during the period, but its importance declined during the Yuan dynasty, and the port was deserted during the Ming dynasty.

According to the Malay Annals, a new ruler named Sang Sapurba was promoted as the new paramount of the Srivijayan mandala. It was said that after he acceded to Seguntang Hill with his two younger brothers, Sang Sapurba entered into a sacred covenant with Demang Lebar Daun, the native ruler of Palembang. The newly installed sovereign afterwards descended from the hill of Seguntang into the great plain of the Musi River, where he married Wan Sendari, the daughter of the local chief, Demang Lebar Daun. Sang Sapurba was said to have reigned in Minangkabau lands.

In 1324, a Srivijaya prince, Sang Nila Utama founded the Kingdom of Singapura (Temasek). According to tradition, he was related to Sang Sapurba. He maintained control over Temasek for 48 years. He was recognized as ruler over Temasek by an envoy of the Chinese Emperor sometime around 1366. He was succeeded by his son Paduka Sri Pekerma Wira Diraja (1372–1386) and grandson, Paduka Seri Rana Wira Kerma (1386–1399). In 1401, the last ruler, Paduka Sri Maharaja Parameswara, was expelled from Temasek by forces from Majapahit or Ayutthaya. He later headed north and founded the Sultanate of Malacca in 1402. The Sultanate of Malacca succeeded the Srivijaya Empire as a Malay political entity in the archipelago.

Rise of Muslim states
Islam came to the Malay Archipelago through the Arab and Indian traders in the 13th century, ending the age of Hinduism and Buddhism. It arrived in the region gradually and became the religion of the elite before it spread to the commoners. The syncretic form of Islam in Malaysia was influenced by previous religions and was originally not orthodox.

Establishment
The port of Malacca on the west coast of the Malay Peninsula was founded in 1400 by Parameswara, a Srivijayan prince fleeing Temasek (now Singapore). Parameswara sailed to Temasek to escape persecution. There he came under the protection of Temagi, a Malay chief from Patani who was appointed by the king of Siam as regent of Temasek. Within a few days, Parameswara killed Temagi and appointed himself regent. Some five years later he had to leave Temasek, due to threats from Siam. During this period, a Javanese fleet from Majapahit attacked Temasek.

Parameswara headed north to find a new settlement, reaching a fishing village at the mouth of the Bertam River (former name of the Melaka River) where he founded what would become the Malacca Sultanate. Over time this developed into modern-day Malacca Town. According to the Malay Annals, here Parameswara saw a mouse deer outwitting a dog resting under a Malacca tree. Taking this as a good omen, he decided to establish a kingdom called Malacca. He built and improved facilities for trade. The Malacca Sultanate is commonly considered the first independent state in the peninsula.

In 1404, the first official Chinese trade envoy led by Admiral Yin Qing arrived in Malacca. Later, Parameswara was escorted by Zheng He and other envoys on his successful visits. Malacca's relationships with Ming granted protection to Malacca against attacks from Siam and Majapahit and Malacca officially submitted as a protectorate of Ming China. This encouraged the development of Malacca into a major trade settlement on the trade route between China and India, the Middle East, Africa and Europe. To prevent the Malaccan empire from falling to the Siamese and Majapahit, he forged a relationship with Ming China for protection. Following the establishment of this relationship, the prosperity of the Malacca entrepôt was then recorded by the first Chinese visitor, Ma Huan, who travelled together with Admiral Zheng He. In Malacca during the early 15th century, Ming China actively sought to develop a commercial hub and a base of operation for their treasure voyages into the Indian Ocean. Malacca had been a relatively insignificant region, not even qualifying as a polity prior to the voyages according to both Ma Huan and Fei Xin, and was a vassal region of Siam. In 1405, the Ming court dispatched Admiral Zheng He with a stone tablet enfeoffing the Western Mountain of Malacca as well as an imperial order elevating the status of the port to a country. The Chinese also established a government depot (官廠) as a fortified cantonment for their soldiers. Ma Huan reported that Siam did not dare to invade Malacca thereafter. The rulers of Malacca, such as Parameswara in 1411, would pay tribute to the Chinese emperor in person.

The emperor of Ming China was sending out fleets of ships to expand trade. Admiral Zheng He called at Malacca and brought Parameswara with him on his return to China, a recognition of his position as ruler of Malacca. In exchange for regular tribute, the Chinese emperor offered Melaka protection from the constant threat of a Siamese attack. Because of its strategic location, Malacca was an important stopping point for Zheng He's fleet. Due to Chinese involvement, Malacca had grown as a key alternative to other important and established ports. The Chinese and Indians who settled in the Malay Peninsula before and during this period are the ancestors of today's Baba-Nyonya and Chitty communities. According to one theory, Parameswara became a Muslim when he married a Princess of Pasai and he took the fashionable Persian title "Shah", calling himself Iskandar Shah. In 1414, Parameswara's son was then officially recognised as the second ruler of Melaka by the Chinese Emperor and styled Raja Sri Rama Vikrama, Raja of Parameswara of Temasek and Malacca and he was known to his Muslim subjects as Sultan Sri Iskandar Zulkarnain Shah (Megat Iskandar Shah). He ruled Malacca from 1414 to 1424. Through the influence of Indian Muslims and, to a lesser extent, Hui people from China, Islam became increasingly common during the 15th century.

Rise of Malacca
After an initial period paying tribute to the Ayutthaya, the kingdom rapidly assumed the place previously held by Srivijaya, establishing independent relations with China, and exploiting its position dominating the Straits to control the China-India maritime trade, which became increasingly important when the Mongol conquests closed the overland route between China and the west.

Within a few years of its establishment, Malacca officially adopted Islam. Parameswara became a Muslim, and because Malacca was under a Muslim prince, the conversion of Malays to Islam accelerated in the 15th century. The political power of the Malacca Sultanate helped Islam's rapid spread through the archipelago. By the start of the 16th century, with the Malacca Sultanate in the Malay Peninsula and parts of Sumatra, the Demak Sultanate in Java, and other kingdoms around the Malay Archipelago increasingly converting to Islam, it had become the dominant religion among Malays, and reached as far as the modern-day Philippines, leaving Bali as an isolated outpost of Hinduism today. The government in Malacca was based on the feudal system.

Malacca's reign lasted little more than a century, but during this time became the established centre of Malay culture. Most future Malay states originated from this period. Malacca became a cultural centre, creating the matrix of the modern Malay culture: a blend of indigenous Malay and imported Indian, Chinese and Islamic elements. Malacca's fashions in literature, art, music, dance and dress, and the ornate titles of its royal court, came to be seen as the standard for all ethnic Malays. The court of Malacca also gave great prestige to the Malay language, which had originally evolved in Sumatra and been brought to Malacca at the time of its foundation. In time Malay came to be the official language of all the Malaysian states, although local languages survived in many places. After the fall of Malacca, the Sultanate of Brunei became the major centre of Islam.

Post-Malaccan sultanates

From the 15th century onwards, the Portuguese started seeking a maritime route to Asia. In 1511, Afonso de Albuquerque led an expedition to Malaya which seized Malacca with the intent of using it as a base for activities in Southeast Asia. This was the first colonial claim in what is now Malaysia. The son of the last Sultan of Malacca, Alauddin Riayat Shah II fled to the southern tip of the peninsula, where he founded a state that which became the Sultanate of Johor in 1528. Another son, Muzaffar Shah I established the Perak Sultanate to the north. Portuguese influence was strong, as they aggressively tried to convert the population of Malacca to Catholicism. In 1571, the Spanish captured Manila and established a colony in the Philippines, reducing the Sultanate of Brunei's power.

After the fall of Malacca to Portugal, the Johor Sultanate on the southern Malay Peninsula and the Sultanate of Aceh on northern Sumatra moved to fill the power vacuum left behind. The three powers struggled to dominate the Malay Peninsula and the surrounding islands. Meanwhile, the importance of the Strait of Malacca as an east–west shipping route was growing, while the islands of Southeast Asia were themselves prized sources of natural resources (metals, spices, etc.) whose inhabitants were being further drawn into the global economy.

In 1607, the Sultanate of Aceh rose as the most powerful and wealthiest state in the Malay Archipelago. Under Sultan Iskandar Muda's reign, the sultanate's control was extended over a number of Malay states. During the Battle of Duyon River, Iskandar Muda's disastrous campaign against Malacca in 1629, the combined Portuguese and Johor forces managed to destroy all the ships of his formidable fleet and 19,000 troops according to a Portuguese account.

In the early 17th century, the Dutch East India Company (Vereenigde Oost-Indische Compagnie, or VOC) was established. Backed by the Dutch, Johor established a loose hegemony over the Malay states, except Perak, which was able to play-off Johor against the Siamese to the north and retain its independence. The Dutch did not interfere in local matters in Malacca, but at the same time diverted most trade to its colonies on Java.

Johor Sultanate
At its height, the sultanate controlled modern-day Johor, several territories by the Klang and Linggi rivers, Singapore, Bintan, Riau, Lingga, Karimun, Bengkalis, Kampar and Siak in Sumatra. The Portuguese and Johor were frequently in conflict in the 16th century, most notably in the 1587 siege of Johor. During the Triangular war, Aceh launched multiple raids against both Johor and Portuguese forces to tighten its grip over the straits. The rise and expansion of Aceh encouraged the Portuguese and Johor to sign a short-lived truce. During the rule of Iskandar Muda, Aceh attacked Johor in 1613 and again in 1615.

In the early 17th century, the Dutch reached Southeast Asia. At that time the Dutch were at war with the Portuguese and allied themselves to Johor. Two treaties were signed between Admiral Cornelis Matelief de Jonge and Raja Bongsu of Johor in 1606. The combined Johor-Dutch forces ultimately failed to capture Malacca in 1606. Finally in 1641, the Dutch and Johor headed by Bendahara Skudai, defeated the Portuguese in the Battle of Malacca. The Dutch took control of Malacca and agreed not to seek territories or wage war with Johor. By the time the fortress at Malacca surrendered, the town's population had already been greatly decimated by famine and disease.

With the fall of Portuguese Malacca in 1641 and the decline of Aceh due to the growing power of the Dutch, Johor started to re-establish itself as a power along the Straits of Malacca during the reign of Sultan Abdul Jalil Shah III (1623–1677). Jambi emerged as a regional economic and political power in Sumatra. Initially there was an attempt of an alliance between Johor and Jambi by way of a promised marriage. However, the alliance broke down and the Johor-Jambi war (1666–1679) ensued. After the sacking of Batu Sawar by Jambi in 1673, the capital of Johor was frequently moved to avoid the threat of attack. The sultan escaped to Pahang and died four years later. His successor, Sultan Ibrahim Shah (1677–1685), then engaged the help of the Bugis in the fight to defeat Jambi. Johor would eventually prevail in 1679, but also ended in a weakened position as the Bugis refused to return to Makassar where they came from. On top of this, the Minangkabaus of Sumatra also started to assert their influence. In the 1690s the Bugis, who played an important role in defeating Jambi two decades earlier, had a major political influence in Johor. Both the Bugis and the Minangkabau realised how the death of Sultan Mahmud II in 1699 caused a power vacuum and allowed them to exert their power in Johor. The Minangkabau introduced a Minangkabau prince, Raja Kecil from Siak who claimed he was the posthumous son of Mahmud II. With the help of the Orang Laut, Raja Kecil then captured Riau in 1718, the then capital of the Johor Sultanate and installed himself as the new Johor Sultan, Jalil Rahmat Shah, without the knowledge of the Bugis. Raja Sulaiman of Johor dethroned Raja Kechil with help from the Bugis Daeng Parani and reclaimed the throne as Sultan Sulaiman Badrul Alam Shah (1722–1760), but he was a weak ruler and became a puppet of the Bugis. During the reign of Sultan Mahmud Shah III, the mid-to-late 18th century saw the Bugis attempting to expand their influence in the region. This brought them into conflicts with the Dutch, which resulted in a final major battle in 1784 between the two, which ended Bugis and Johor dominance in the region.

Perak Sultanate
Based on the Perak Royal Genealogy ("Salasilah Raja-Raja Perak"), the Perak Sultanate was formed in the early 16th century on the banks of the Perak River by the eldest son of Malaccan Sultan Mahmud Shah. He ascended to the throne as Muzaffar Shah I (1528–1549), first Sultan of Perak, after surviving the capture of Malacca by the Portuguese in 1511 and living quietly in Siak for a period. He became sultan through the efforts of Tun Saban, a local leader and trader between Perak and Klang. There had been no sultans in Perak when Tun Saban first arrived in the area from Kampar in Sumatra. Most of the area's residents were traders from Malacca, Selangor and Sumatra. Perak's administration became more organised after the Sultanate was established. With the opening up of Perak in the 16th century, the state became a source of tin ore. It appears that anyone was free to trade in the commodity, although the tin trade did not attract significant attention until the 1610s.

Throughout the early 17th century, the Sultanate of Aceh continually harassed most parts of the Malay Peninsula. Although Perak fell under the authority of Aceh, it remained entirely independent from Siamese control for over 200 years from 1612, in contrast with its neighbour, Kedah, and other northern Malay sultanates.

When the last Perak sultan of direct Malaccan lineage, Sallehuddin Riayat Shah died without an heir in 1635, a state of uncertainty prevailed in Perak. This was exacerbated by a deadly cholera epidemic. Perak chieftains were left with no alternative but to turn to Iskandar Thani of Aceh, who sent his relative, Raja Sulong, to become the new Perak Sultan, Muzaffar Shah II (1636–1653).

Aceh's influence on Perak began to wane when the Dutch East India Company (VOC) arrived, in the mid-17th century. When Perak refused to enter into a contract with the VOC as its northern neighbours had done, a blockade of the Perak River halted the tin trade, causing suffering among Aceh's merchants. In 1650, Aceh's Sultana Taj ul-Alam ordered Perak to sign an agreement with the VOC, on condition that the tin trade would be conducted exclusively with Aceh's merchants. By the following year, the VOC had secured a monopoly over the tin trade, setting up a store in Perak. Following the long competition between Aceh and the VOC over Perak's tin trade, on 15 December 1653, the two parties jointly signed a treaty with Perak granting the Dutch exclusive rights to tin extracted from mines located in the state.

In 1699, when Johor lost its last sultan of Malaccan lineage, Sultan Mahmud Shah II, Perak now had the sole claim of being the final heir of the old Sultanate of Malacca. However, Perak could not match the prestige and power of either the Malaccan or Johor Sultanates. Perak endured 40 years of civil war in the early 18th century, where rival princes were bolstered by local chiefs, the Bugis and Minang, all fighting for a share of tin revenues. The Bugis and several Perak chiefs were successful in ousting the Perak ruler, Sultan Muzaffar Riayat Shah III in 1743. In 1747, he only held power in north Perak and signed a treaty with the Dutch Commissioner Ary Verbrugge, under which Perak's ruler recognised Dutch monopoly over the tin trade and agreed to sell all the tin ore to Dutch traders.

Pahang Sultanate
The Old Pahang Sultanate centred in modern-day Pekan was established in the 15th century. At the height of its influence, the sultanate controlled the entire Pahang basin. The sultanate had its origins as a vassal to the Malaccan Sultanate. Its first sultan was a Malaccan prince, Muhammad Shah (1455–1475), himself the grandson of Dewa Sura, the last pre-Malaccan ruler of Pahang. Over the years, Pahang grew independent from Malaccan control and at one point even established itself as a rival state to Malacca until the latter's demise in 1511. In 1528, when the last Malaccan sultan died, the sultan at the time, Mahmud Shah I (c. 1519–1530) joined forces with the Sultan of Johor, Alauddin Riayat Shah II, and began to expel the Portuguese from the Malay Peninsula. Two attempts were made in 1547 at Muar and in 1551 at Portuguese Malacca. However, in the face of superior Portuguese arms and vessels, the Pahang and Johor forces were forced to retreat on both occasions.

During the reign of Sultan Abdul Kadir (1560–1590), Pahang enjoyed a brief period of cordial relations with the Portuguese in the second half of the 16th century. However, in 1607, following a visit by Admiral Matelief de Jonge of the Dutch Empire, Pahang cooperated with them in an attempt to get rid of the Portuguese. There was an attempt to establish a Johor-Pahang alliance to assist the Dutch. However, a quarrel erupted between Sultan Abdul Ghafur of Pahang (1592–1614) and Alauddin Riayat Shah III of Johor (1597–1615). This resulted in Johor declaring war on Pahang in 1612; with the aid of Sultan Abdul Jalilul Akbar of Brunei, Pahang eventually defeated Johor in 1613.

In 1615, the Acehnese Iskandar Muda invaded Pahang, forcing Alauddin Riayat Shah to retreat into the interior of Pahang. He nevertheless continued to exercise some ruling powers. His reign in exile is considered to have officially ended after the installation of a distant Johorean relative, Raja Bujang (Abdul Jalil Shah III) to the Pahang throne in 1615 with the support of the Portuguese. However, he was eventually deposed in the Acehnese invasion of 1617, but restored to the Pahang throne and also installed as the new Sultan of Johor following the death of his uncle, Sultan Abdullah Ma'ayat Shah in 1623. This event led to the union of the crown of Pahang and Johor, and the formal establishment of Pahang-ruled Johor.

Selangor Sultanate
During the 17th century Johor-Jambi war, Sultan Abdul Jalil Shah III (r. 1623–1677) of Johor engaged the help of Bugis mercenaries from Sulawesi to fight against Jambi. After Johor won in 1679, the Bugis decided to stay and asserted their power in the region. Many Bugis began to migrate and settle along the coast of Selangor such as the estuaries of the Selangor and Klang rivers. Some Minangkabaus may have also settled in Selangor by the 17th century, perhaps earlier. The Bugis and the Minangkabaus from Sumatra struggled for control of Johor. Raja Kecil, backed by the Minangkabaus, invaded Selangor but were driven off by the Bugis in 1742. To establish a power base, the Bugis led by Raja Salehuddin (1705–1788) founded the present hereditary Selangor Sultanate with its capital at Kuala Selangor in 1766. Selangor is unique as it is the only state on the Malay Peninsula that was founded by the Bugis.

Brunei Sultanate
Before its conversion to Islam, the oldest records of Brunei in Arabic sources defined it as "Sribuza" which was a Bornean Vassal-State to Srivijaya. The Arabic author Ya'qubi writing in the 9th century recorded that the kingdom of Musa (probably referring to Brunei) was in alliance with the kingdom of Mayd (either Ma-i or Madja-as in the Philippines), against the Tang dynasty.

One of the earliest Chinese records of an independent kingdom in Borneo was the 977 letter to the Song dynasty emperor from the ruler of Boni (Brunei). The Bruneians regained their independence from Srivijaya due to the onset of a Javanese-Sumatran war. In 1225, the Chinese official Zhao Rukuo reported that Boni had 100 warships to protect its trade, and that there was great wealth in the kingdom. In the 14th century, a Chinese annal (Yuan Dade Nanhai zhi) reported that Boni invaded or administered Sabah, some parts of Sarawak and ruled the kingdoms of Butuan, Sulu and Mayd, as well as Malilu and Wenduling in present-day Manila and Mindanao, at northern and southern Philippines, respectively. Later, the Sulu kingdom invaded and occupied ports in Boni-ruled Sabah. They were later evicted with the help of the Majapahit Empire, which Brunei became a vassal to in the late 14th century. Nevertheless the Sulus stole 2 Sacred Pearls from the Brunei king.

By the 15th century, the empire became a Muslim state, when the king of Brunei converted to Islam, brought Muslim Indians and Arab merchants from other parts of Maritime Southeast Asia, who came to trade and spread Islam. During the rule of Bolkiah (1485–1524) the empire controlled the coastal areas of northwest Borneo and reached the Philippines at Seludong (present-day Manila), the Sulu Archipelago and some parts of Mindanao which Brunei had incorporated via royal intermarriage with the rulers of Sulu, Manila and Maguindanao.

16th–18th century
In the 16th century, the Brunei empire's influence also extended as far as Kapuas River delta in West Kalimantan. Other sultanates in the area had close relations with the Brunei Monarchy, being in some cases effectively under the hegemony of the Brunei ruling family for periods of time, such as the Malay sultans of Pontianak, Samarinda and Banjarmasin. The Malay Sultanate of Sambas (present-day West Kalimantan), the Sultanate of Sulu and the Muslim Rajahs of precolonial Manila had developed dynastic relations with the royal house of Brunei. The Sultanate of Sarawak (covering present day Kuching, known to the Portuguese cartographers as Cerava, and one of the five great seaports on the island of Borneo), though under the influence of Brunei, was self-governed under Sultan Tengah before being fully integrated into the Bruneian Empire upon sultan Tengah's death in 1641.

The Bruneian empire began to decline during the arrival of western powers. Spain sent several expeditions from Mexico to invade and colonise Brunei's territories in the Philippines. Eventually the Spanish, their Visayan allies and their Latin-American recruits assaulted Brunei itself during the Castilian War. Though there were rapes, sacks and pillaging, the invasion was only temporary as the Spanish retreated. Brunei was unable to regain the territory it lost in the Philippines, yet it still maintained sway in Borneo.

19th century
By the early 19th century, Sarawak had become a loosely governed territory under the control of the Brunei Sultanate. Brunei only had authority along the coastal regions of Sarawak where it was held by semi-independent Malay leaders. Meanwhile, the interior of Sarawak suffered from tribal wars fought by Iban, Kayan, and Kenyah peoples, who aggressively fought to expand their territories.

Following the discovery of antimony ore in the Kuching region, Pangeran Indera Mahkota (a representative of the Sultan of Brunei) began to develop the territory between 1824 and 1830. When antimony production increased, the Brunei Sultanate demanded higher taxes from Sarawak, which led to civil unrest and chaos. In 1839, Sultan Omar Ali Saifuddin II (1827–1852), ordered his uncle the Pengiran Muda Hashim to restore order. It was around this time that James Brooke arrived in Sarawak, and Pengiran Muda Hashim requested his assistance in the matter, but Brooke refused. However, he agreed to a further request during his next visit to Sarawak in 1840. On 24 September 1841, Pengiran Muda Hashim agreed to depose Pangeran Indera Mahkota and bestow the title of governor on James Brooke. This appointment was later confirmed by the Sultan of Brunei in 1842.

Struggles for hegemony
The weakness of the small coastal Malay states led to the immigration of the Bugis, escaping from Dutch colonisation of Sulawesi, who established numerous settlements on the peninsula which they used to interfere with Dutch trade. They seized control of Johor following the assassination of the last Sultan of the old Melaka royal line in 1699. Bugis expanded their power in the states of Johor, Kedah, Perak, and Selangor. The Minangkabau from central Sumatra migrated into Malaya, and eventually established their own state in Negeri Sembilan. The fall of Johor left a power vacuum on the Malay Peninsula which was partly filled by the Siamese kings of the Ayutthaya Kingdom, who made the five northern Malay states—Kedah, Kelantan, Patani, Perlis, and Terengganu—their vassals.

The economic importance of Malaya to Europe grew rapidly during the 18th century. The fast-growing tea trade between China and United Kingdom increased the demand for high-quality Malayan tin, which was used to line tea-chests. Malayan pepper also had a high reputation in Europe, while Kelantan and Pahang had gold mines. The growth of tin and gold mining and associated service industries led to the first influx of foreign settlers into the Malay world – initially Arabs and Indians, later Chinese.

Siamese expansion into Malaya
After the Fall of Ayutthaya in 1767, the Northern Malay Sultanates were freed from Siamese domination temporarily. In 1786, British trader Francis Light managed to obtain a lease of Penang Island from Sultan Ahmad Tajuddin Halim Shah II of Kedah on behalf of East India Company. Siam re-exerted control over Northern Malay Sultanates and sacked Pattani; Kedah came under Siamese suzerainty. King Rama II of Siam ordered Noi Na Nagara of Ligor to invade Kedah Sultanate in 1821. Under the Burney Treaty of 1826, the exiled Kedah Sultan Ahmad Tajuddin was not restored to his throne. He and his armed supporters then fought in a series of war known as Perang Musuh Bisik for his restoration over twelve years (1830–1842). When the Siamese army invaded and occupied Kedah between 1821 and 1842, local Arab families supported the Sultan's efforts to lead resistance. In 1842, Sultan Ahmad Tajuddin finally agreed to accept Siamese terms and was restored to his throne of Kedah. The following year, Syed Hussein Jamalullail was installed by the Siamese as the first Raja of Perlis, after the Sultan of Kedah gave his endorsement for the formation of Perlis, Siam separated Perlis into a separate principality directly vassal to Bangkok.

Around 1760, Long Yunus, an aristocratic warlord of Patani origin succeeded in unifying the territory of present-day Kelantan and was succeeded in 1795 by his son-in-law, Tengku Muhammad by Sultan Mansur of Terengganu. The enthronement of Tengku Muhammad by a noble from Terengganu was opposed by Long Yunus' sons, thus triggering a war against Terengganu by Long Muhammad, the eldest son of Long Yunus. The pro-Terengganu faction was defeated in 1800 and Long Muhammad ruled Kelantan with the new title of sultan as Sultan Muhammad I. Terengganu experienced stability under the reign of Sultan Omar Riayat Shah, who was remembered as a devout ruler who promoted trade and stable government. Under Thai rule, Terengganu prospered, and was largely left alone by the authorities in Bangkok. However, in the Burney Treaty of 1826, the treaty acknowledged Siamese claims over several northern Malay states Kedah, Kelantan, Perlis, Terengganu—the future Unfederated Malay States—and Patani. The treaty further guaranteed British possession of Penang and their rights to trade in Kelantan and Terengganu without Siamese interference. However, the five Malay-ethnic states were not represented in the treaty negotiation. In 1909 the parties of the agreement signed a new treaty that superseded the Burney Treaty and transferred four of the five Malay states from Siamese to British control, except for Patani. As Patani was not included in the Anglo-Siamese Treaty of 1909 and remained under Siamese rule, this led Patani to be excluded from the Federation of Malaya in 1957.

British influence

Before the mid-19th-century British interests in the region were predominantly economic, with little interest in territorial control. Already the strongest European power in India, the British were looking towards southeast Asia for new territories. The growth of the China trade in British ships increased the East India Company's desire for bases in the region. Various islands were used for this purpose, but the first permanent acquisition was Penang, leased from the Sultan of Kedah in 1786. This was followed soon after by the leasing of a block of territory on the mainland opposite Penang (known as Province Wellesley). In 1795, during the Napoleonic Wars, the British with the consent of the French-occupied Netherlands occupied Dutch Melaka to forestall possible French encroachment.

When Malacca was handed back to the Dutch in 1818, the British governor, Stamford Raffles, looked for an alternative base, and in 1819 he acquired Singapore from the Sultan of Johor. The exchange of the British colony of Bencoolen for Malacca with the Dutch left the British as the sole colonial power on the peninsula. The territories of the British were set up as free ports, attempting to break the monopoly held by the Dutch and French at the time, and making them large bases of trade. They allowed Britain to control all trade through the straits of Malacca. British influence was increased by Malayan fears of Siamese expansionism, to which Britain made a useful counterweight. During the 19th century the Malay Sultans aligned themselves with the British Empire, due to the benefits of associations with the British and their fear of Siamese or Burmese incursions.

In 1824, British control in Malaya (before the name Malaysia) was formalised by the Anglo-Dutch Treaty, which divided the Malay Archipelago between Britain and the Netherlands. The Dutch evacuated Melaka and renounced all interest in Malaya, while the British recognised Dutch rule over the rest of the East Indies. By 1846 the British controlled Penang, Malacca, Singapore, and the island of Labuan, which they established as the crown colony of the Straits Settlements, administered first under the East India Company until 1867, when they were transferred to the Colonial Office in London.

British in Malaya
Initially, the British followed a policy of non-intervention in relations between the Malay states. The commercial importance of tin mining in the Malay states to merchants in the Straits Settlements led to infighting between the aristocracy on the peninsula. The destabilisation of these states damaged the commerce in the area. The wealth of Perak's tin mines made political stability there a priority for British investors, and Perak was thus the first Malay state to agree to the supervision of a British resident. The Royal Navy was employed to bring about a peaceful resolution to civil disturbances caused by Chinese and Malay gangs employed in a political fight between Ngah Ibrahim and Raja Muda Abdullah. The Pangkor Treaty of 1874 paved the way for the expansion of British influence in Malaya. The British concluded treaties with some Malay states, installing residents who advised the Sultans and soon became the de facto rulers of their states. These advisors held power in everything except to do with Malay religion and customs.

Johor was the sole remaining state to maintain its independence, by modernising and giving British and Chinese investors legal protection. By the turn of the 20th century, the states of Pahang, Selangor, Perak, and Negeri Sembilan, known together as the Federated Malay States, had British advisors. In 1909 the Siamese kingdom was compelled to cede Kedah, Kelantan, Perlis and Terengganu, which already had British advisors, over to the British. Sultan Abu Bakar of Johor and Queen Victoria were personal acquaintances who recognised each other as equals. It was not until 1914 that Sultan Abu Bakar's successor, Sultan Ibrahim, accepted a British adviser. The four previously Thai states and Johor were known as the Unfederated Malay States. The states under the most direct British control developed rapidly, becoming the largest suppliers in the world of first tin, then rubber.

By 1910, the pattern of British rule in the Malay lands was established. The Straits Settlements were a Crown colony, ruled by a governor under the supervision of the Colonial Office in London. Their population was about roughly 50% Chinese-Malaysian, but all residents, regardless of race, were British subjects. The first four states to accept British residents, Perak, Selangor, Negeri Sembilan, and Pahang, were termed the Federated Malay States: while technically independent, they were placed under a Resident-General in 1895. The Unfederated Malay States (Johore, Kedah, Kelantan, Perlis, and Terengganu) had a slightly larger degree of independence. Johor, as Britain's closest ally in Malay affairs, had the privilege of a written constitution, which gave the Sultan the right to appoint his own Cabinet, but he was generally careful to consult the British first.

British in Borneo

During the late 19th century the British also gained control of the north coast of Borneo. Development on the peninsula and Borneo were generally separate until the 19th century. The eastern part of this region (now Sabah) was under the nominal control of the Sultan of Sulu, who later became a vassal of the Spanish East Indies. The rest was the territory of the Sultanate of Brunei. In 1840, British adventurer James Brooke helped suppress a revolt, and in return received the title of Raja and the right to govern the Sarawak River District in 1841. In 1843, his title was recognised as hereditary, and the "White Rajahs" began ruling Sarawak as a de facto independent state in 1846. The Brookes expanded Sarawak at the expense of Brunei.

In 1881, the British North Borneo Company was granted control of the territory of British North Borneo, appointing a governor and legislature. Its status was similar to that of a British Protectorate, and like Sarawak it expanded at the expense of Brunei. Until the Philippine independence in 1946, seven British-controlled islands in the north-eastern part of Borneo named Turtle Islands and Cagayan de Tawi-Tawi were ceded to the Philippine government by Crown Colony of North Borneo. The Philippines then under its irredentism motive since the administration of President Diosdado Macapagal laying claim to eastern Sabah in a basis the territory was part of the present-defunct Sultanate of Sulu's territory. In 1888, what was left of Brunei was made a British protectorate, and in 1891 another Anglo-Dutch treaty formalised the border between British and Dutch Borneo.

Race relations during colonial era
In the pre-colonial period and in the first few decades after the imposition of formal colonial rule in British Malaya, 'Malay' was not a racial or even a fixed identity in the modern sense of these terms. The construct of race was imposed by the British on their colonial subjects.

Unlike some colonial powers, the British always saw their empire as an economic concern, and its colonies were expected to turn a profit for shareholders in London. The colonial capitalist ideas of development were largely based on unlimited greed for profit. Initially, British colonisers were attracted by the Malay Archipelago's tin and gold mines. But British planters soon began to experiment with tropical plantation crops—tapioca, gambier, pepper, and coffee. And, in 1877, the rubber plant was introduced from Brazil. Rubber soon became Malaya's staple export, stimulated by booming demand from European industry. Later, rubber was joined by palm oil as an export earner. All these industries required a large labour force, so the British sent people from the longer-established British colony in India, consisting mainly of Tamil-speakers from South India, to work on plantations as indentured labourers. The mines, mills and docks also attracted a flood of immigrant workers from southern China. Soon towns like Singapore, Penang, and Ipoh were majority Chinese, as was Kuala Lumpur, founded as a tin-mining centre in 1857. By 1891, when Malaya's first census was taken, Perak and Selangor, the main tin-mining states, had Chinese majorities.

Workers were often treated violently by contractors, and sickness was frequent. Many Chinese labourers' debts increased through addictions to opium and gambling, which earned the British colonial government significant revenue, while Indian labourers' debts were increased through addiction to drink. Workers' debts acquired in this way meant that they were tied to their labour contracts for much longer.

Some Chinese immigrant workers were connected with networks of mutual aid societies (run by "Hui-Guan" 會館, or non-profit organisations). In the 1890s Yap Ah Loy, who held the title of Kapitan China of Kuala Lumpur, was the richest man in Malaya, owning a chain of mines, plantations and shops. Malaya's banking and insurance industries were run by the Chinese from the start, and Chinese businesses, usually in partnership with London firms, soon had complete control of the Malayan economy. Chinese bankers also lent money to the Malay Sultans, which gave the Chinese political as well as economic leverage. At first the Chinese immigrants were mostly men. At first they married Malay women, producing a community of Sino-Malayans or baba people, but soon they began importing Chinese brides, establishing permanent communities and building schools and temples.

An Indian commercial and professional class emerged during the early 20th century, but the majority of Indians remained poor and uneducated in rural ghettos in the rubber-growing areas.

Traditional Malay society was greatly harmed by the loss of political sovereignty to the British colonisers. The Sultans, who were seen as collaborators with both the British and the Chinese, lost some of their traditional prestige, but the mass of rural Malays continued to revere the Sultans. A small class of Malay nationalist intellectuals began to emerge during the early 20th century, and there was also a revival of Islam in response to the perceived threat of other imported religions, particularly Christianity. In fact few Malays converted to Christianity, although many Chinese did. The northern regions, which were less influenced by western ideas, became strongholds of Islamic conservatism.

The British gave elite Malays positions in the police and local military units, as well as a majority of those administrative positions open to non-Europeans. While the Chinese mostly built and paid for their own schools and colleges, importing teachers from China, the British aimed to control the education of young Malay elites and establish colonial ideas of race and class hierarchies. The colonial government opened Malay College in 1905 and created the Malay Administrative Service in 1910. (The college was dubbed "Bab ud-Darajat" – the Gateway to High Rank.) A Malay Teachers College followed in 1922, and a Malay Women's Training College in 1935. All this reflected the official policy of the colonial administration that Malaya belonged to the Malays, and that the other races were but temporary residents. This view was increasingly out of line with reality, and resulted in the formation of resistance movements against British Colonial rule.

The Malay teacher's college had lectures and writings that nurtured Malay nationalist sentiments; it is known as the birthplace of Malay nationalism. In 1938, Ibrahim Yaacob, an alumnus of Sultan Idris College, established the Kesatuan Melayu Muda (Young Malays Union or KMM) in Kuala Lumpur. It was the first nationalist political organisation in British Malaya. A specific ideal the KMM held was Panji Melayu Raya, which called for the unification of British Malaya and the Dutch East Indies.

In the years before World War II, the colonial government were concerned with finding the balance between a centralised state and maintaining the power of the Sultans in Malaya. In 1935 the position of Resident-General of the Federated States was abolished, and its powers decentralised to the individual states. The colonial government regarded the Chinese as clever but dangerous—and indeed during the 1920s and 1930s, the Chinese Nationalist Party (the Kuomintang) and the Chinese Communist Party built rival clandestine organisations in Malaya, leading to regular disturbances in the Chinese towns.

Although a belligerent as part of the British Empire, Malaya saw little action during World War I, except for the sinking of the Russian cruiser Zhemchug by the German cruiser SMS Emden on 28 October 1914 during the Battle of Penang.

World War II and the state of emergency

The outbreak of war in the Pacific in December 1941 found the British in Malaya completely unprepared. During the 1930s, anticipating the rising threat of Japanese naval power, they had built a great naval base at Singapore, but never anticipated an invasion of Malaya from the north. There was virtually no British air capacity in the Far East. The Japanese were thus able to attack from their bases in French Indo-China with impunity, and despite resistance from British, Australian, and Indian forces, they overran Malaya in two months. Singapore, with no landward defences, no air cover, and no water supply, was forced to surrender in February 1942. British North Borneo and Brunei were also occupied.

The Japanese colonial government regarded the Malays from a pan-Asian point of view, and fostered a limited form of Malay nationalism. The Malay nationalist Kesatuan Melayu Muda, advocates of Melayu Raya, collaborated with the Japanese, based on the understanding that Japan would unite the Dutch East Indies, Malaya and Borneo and grant them independence. The occupiers regarded the Chinese, however, as enemy aliens, and treated them with great harshness: during the so-called sook ching (purification through suffering), up to 80,000 Chinese in Malaya and Singapore were killed. The Chinese, led by the Malayan Communist Party (MCP), became the backbone of the Malayan Peoples' Anti-Japanese Army (MPAJA). With British assistance, the MPAJA became the most effective resistance force in the occupied Asian countries.

Although the Japanese argued that they supported Malay nationalism, they offended Malay nationalism by allowing their ally Thailand to re-annex the four northern states, Kedah, Perlis, Kelantan, and Terengganu that had been transferred to British Malaya in 1909. The loss of Malaya's export markets soon produced mass unemployment which affected all races and made the Japanese increasingly unpopular.

During occupation, ethnic tensions were raised and nationalism grew. The Malayans were thus on the whole glad to see the British back in 1945, but things could not remain as they were before the war, and a stronger desire for independence grew. Britain was bankrupt and the new Labour government was keen to withdraw its forces from the East. But most Malays were more concerned with defending themselves against the MCP than with demanding independence from the British.

In 1944, the British drew up plans for a Malayan Union, which would turn the Federated and Unfederated Malay States, plus Penang and Malacca (but not Singapore), into a single Crown colony, with a view towards independence. The Bornean territories and Singapore were left out as it was thought this would make union more difficult to achieve. There was however strong opposition from the Malays, who opposed the weakening of the Malay rulers and the granting of citizenship to the ethnic Chinese and other minorities. The British had decided on legalised equality between all races as they perceived the Chinese and Indians as more loyal to the British during the war than the Malays. The Sultans, who had initially supported it, backed down and placed themselves at the head of the resistance.

In 1946, the United Malays National Organisation (UMNO) was founded by Malay nationalists led by Dato Onn bin Jaafar, the Chief Minister of Johor. UMNO favoured independence for Malaya, but only if the new state was run exclusively by the Malays. Faced with Malay opposition, the British dropped the plan for equal citizenship. The Malayan Union was thus established in 1946, and was dissolved in 1948 and replaced by the Federation of Malaya, which restored the autonomy of the rulers of the Malay states under British protection.

Meanwhile, the Communists were moving towards open insurrection. The MPAJA had been disbanded in December 1945, and the MCP organised as a legal political party, but the MPAJA's arms were carefully stored for future use. The MCP policy was for immediate independence with full equality for all races. The Party's strength was in the Chinese-dominated trade unions, particularly in Singapore, and in the Chinese schools. In March 1947, reflecting the international Communist movement's "turn to left" as the Cold War set in, the MCP leader Lai Tek was purged and replaced by the veteran MPAJA guerrilla leader Chin Peng, who turned the party increasingly to direct action. These rebels, under the leadership of the MCP, launched guerrilla operations designed to force the British out of Malaya. In July, following a string of assassinations of plantation managers, the colonial government struck back, declaring a State of emergency, banning the MCP and arresting hundreds of its militants. The Party retreated to the jungle and formed the Malayan Peoples' Liberation Army, with about 13,000 men under arms, mostly ethnic Chinese.

The war was precipitated by the new constitution desired by Britain, which condemned about 90 percent of ethnic Chinese to non-citizenship, and by the eviction of poor peasants to make way for plantations. But although the war was long portrayed in most analyses by British authorities as a struggle against communism in a Cold War context, the MNLA received very little support from either the Soviet or Chinese communists. Rather, the main concern of British governments was to protect their commercial interests in the colony.

The Malayan Emergency lasted from 1948 to 1960 and involved a long anti-insurgency campaign by Commonwealth troops in Malaya. The British strategy, which proved ultimately successful, was to isolate the MCP from its support base by a combination of economic and political concessions to the Chinese and the resettlement of Chinese squatters into "New Villages", in reality, concentration camps, in "white areas" free of MCP influence. From 1949 the MCP campaign lost momentum and the number of recruits fell sharply. Although the MCP succeeded in assassinating the British High Commissioner, Sir Henry Gurney, in October 1951, this turn to terrorist tactics alienated many moderate Chinese from the Party. The arrival of Lt.-Gen Sir Gerald Templer as British commander in 1952 was the beginning of the end of the Emergency. Templer helped create the modern techniques of counter-insurgency warfare in Malaya and applied them against the MCP guerillas. The war was accompanied by abuses on both sides. The most notorious atrocity was committed in the village of Batang Kali, north of the capital Kuala Lumpur, in December 1948, when the British army massacred 24 Chinese before burning the village to the ground. Heavy bombers went to war, dropping thousands of bombs on insurgent positions. Britain conducted 4,500 air strikes in the first five years of the conflict. Although the insurgency was defeated Commonwealth troops remained with the backdrop of the Cold War against the Soviet Union. Against this backdrop, independence for the Federation within the Commonwealth was granted on 31 August 1957, with Tunku Abdul Rahman as the first prime minister.

Struggle for independent Malaysia
Chinese reaction against the MCP was shown by the formation of the Malayan Chinese Association (MCA) in 1949 as a vehicle for moderate Chinese political opinion. Its leader Tan Cheng Lock favoured a policy of collaboration with UMNO to win Malayan independence on a policy of equal citizenship, but with sufficient concessions to Malay sensitivities to ease nationalist fears. Tan formed a close collaboration with Tunku (Prince) Abdul Rahman, the Chief Minister of Kedah and from 1951 successor to Datuk Onn as leader of UMNO. Both leaders were determined to forge an agreement their communities could live with as a basis for a stable independent state. The UMNO-MCA Alliance, which was later joined by the Malayan Indian Congress (MIC), won convincing victories in local and state elections in both Malay and Chinese areas between 1952 and 1955. After Joseph Stalin's death in 1953, there was a split in the MCP leadership over the wisdom of continuing the armed struggle. Many MCP militants lost heart and went home, and by the time Templer left Malaya in 1954, the Emergency was over, although Chin Peng led a diehard group that lurked in the inaccessible country along the Thai border for many years. During 1955 and 1956 UMNO, the MCA and the British hammered out a constitutional settlement for a principle of equal citizenship for all races. In exchange, the MCA agreed that Malaya's head of state would be drawn from the ranks of the Malay Sultans, that Malay would be the official language, and that Malay education and economic development would be promoted and subsidised. In effect, this meant that Malaya would be run by the Malays, but that the Chinese and Indians would have proportionate representation in the Cabinet and the parliament, would run those states where they were the majority, and would have their economic position protected. The difficult issue of who would control the Education system was deferred until after independence. This came on 31 August 1957, when Tunku Abdul Rahman became the first Prime Minister of independent Malaya.

After the Japanese surrender the Brooke family and the British North Borneo Company gave up their control of Sarawak and North Borneo respectively, and these became British Crown Colonies. They were much less economically developed than Malaya, and their local political leaderships were too weak to demand independence. Singapore, with its large Chinese majority, achieved autonomy in 1955, and in 1959 the young leader Lee Kuan Yew became Prime Minister. The Sultan of Brunei remained as a British client in his oil-rich enclave. Between 1959 and 1962 the British government orchestrated complex negotiations between these local leaders and the Malayan government.

On 24 April 1961, Lee Kuan Yew proposed the idea of forming Malaysia during a meeting to Tunku Abdul Rahman. Deputy Malayan Prime Minister Abdul Razak supported the idea of the new federation and worked to convince Tunku to back it. On 27 May 1961, Abdul Rahman proposed the idea of forming "Malaysia", which would consist of Brunei, Malaya, North Borneo, Sarawak, and Singapore, all except Malaya still under British rule. It was stated that this would allow the central government to better control and combat communist activities, especially in Singapore. It was also feared that if Singapore became independent, it would become a base for Chinese chauvinists to threaten Malayan sovereignty. The proposed inclusion of British territories besides Singapore was intended to keep the ethnic composition of the new nation similar to that of Malaya, with the Malay and indigenous populations of the other territories canceling out the Chinese majority in Singapore.

Although Lee Kuan Yew supported the proposal, his opponents from the Singaporean Socialist Front (Barisan Sosialis) resisted. In North Borneo, where there were no political parties, community representatives also stated their opposition. Although the Sultan of Brunei supported the merger, the Parti Rakyat Brunei opposed it as well. At the Commonwealth Prime Ministers Conference in 1961, Abdul Rahman explained his proposal further to its opponents. In October, he obtained agreement from the British government to the plan, provided that feedback be obtained from the communities involved in the merger.

The Cobbold Commission approved a merger with North Borneo and Sarawak; however, it was found that a substantial number of Bruneians opposed merger. North Borneo drew up a list of points, referred to as the 20-point agreement, proposing terms for its inclusion in the new federation. Sarawak prepared a similar memorandum, known as the 18-point agreement. Some of the points in these agreements were incorporated into the eventual constitution, some were instead accepted orally. These memoranda are often cited by those who believe that Sarawak's and North Borneo's rights have been eroded over time. A referendum was conducted in Singapore to gauge opinion, and 70% supported merger with substantial autonomy given to the state government. The Sultanate of Brunei withdrew from the planned merger due to opposition from certain segments of its population as well as arguments over the payment of oil royalties and the status of the sultan in the planned merger. Additionally, the Bruneian Parti Rakyat Brunei staged an armed revolt, which, though it was put down, was viewed as potentially destabilising to the new nation.

After reviewing the Cobbold Commission's findings, the British government appointed the Landsdowne Commission to draft a constitution for Malaysia. The eventual constitution was essentially the same as the 1957 constitution, albeit with some rewording; for instance, giving recognition to the special position of the natives of the Borneo States. North Borneo, Sarawak and Singapore were also granted some autonomy unavailable to the states of Malaya. After negotiations in July 1963, it was agreed that Malaysia would come into being on 31 August 1963, consisting of Malaya, North Borneo, Sarawak, and Singapore. The date was to coincide with the independence day of Malaya and the British giving self-rule to Sarawak and North Borneo. However, Indonesia and the Philippines strenuously objected to this development, with Indonesia claiming Malaysia represented a form of "neocolonialism" and the Philippines claiming North Borneo as its territory. The opposition from the Indonesian government led by Sukarno and attempts by the Sarawak United People's Party delayed the formation of Malaysia. Due to these factors, an eight-member UN team was formed to re-ascertain whether North Borneo and Sarawak truly wanted to join Malaysia. Malaysia formally came into being on 16 September 1963, consisting of Malaya, North Borneo, Sarawak, and Singapore. In 1963 the total population of Malaysia was about 10 million.

Challenges of independence
At the time of independence, Malaya had great economic advantages. It was among the world's leading producers of three valuable commodities, rubber, tin, and palm oil, and was also a significant iron ore producer. These export industries gave the Malayan government a healthy surplus to invest in industrial development and infrastructure projects. Like other developing nations in the 1950s and 1960s, Malaya (and later Malaysia) placed great stress on state planning, although UMNO was never a socialist party. The First and Second Malayan Plans (1956–1960 and 1961–1965 respectively) stimulated economic growth through state investment in industry and repairing infrastructure. The government was keen to reduce Malaya's dependence on commodity exports and was aware that demand for natural rubber was bound to fall as the production and use of synthetic rubber expanded.

Both Indonesia and the Philippines withdrew their ambassadors from Malaya on 15 September 1963, the day before Malaysia's formation. In Jakarta the British and Malayan embassies were stoned, and the British consulate in Medan was ransacked with Malaya's consul taking refuge in the US consulate. Malaysia withdrew its ambassadors in response, and asked Thailand to represent Malaysia in both countries.

Indonesian President Sukarno, backed by the powerful Communist Party of Indonesia (PKI), chose to regard Malaysia as a "neocolonialist" plot against his country, and backed a Communist insurgency in Sarawak, mainly involving elements of the local Chinese community. Indonesian irregular forces were infiltrated into Sarawak, where they were contained by Malaysian and Commonwealth of Nations forces. This period of Konfrontasi, an economic, political, and military confrontation lasted until the downfall of Sukarno in 1966. The Philippines objected to the formation of the federation, claiming North Borneo was part of Sulu, and thus the Philippines. In 1966 the new president, Ferdinand Marcos, dropped the claim, although it has since been revived and is still a point of contention marring Philippine–Malaysian relations.

Racial strife
The Depression of the 1930s, followed by the outbreak of the Sino-Japanese War, had the effect of ending Chinese emigration to Malaya. At the time of independence in 1957, Malays comprised 55% of the population, Chinese 35% and Indians 10%. This balance was altered by the inclusion of the majority-Chinese Singapore, upsetting many Malays. The federation increased the Chinese proportion to close to 40%. Both UMNO and the MCA were nervous about the possible appeal of Lee's People's Action Party (then seen as a radical socialist party) to voters in Malaya and tried to organise a party in Singapore to challenge Lee's position there. Lee in turn threatened to run PAP candidates in Malaya at the 1964 federal elections, despite an earlier agreement that he would not do so (see PAP–UMNO Relations). Racial tensions intensified as PAP created an opposition alliance aiming for equality between races. This provoked Tunku Abdul Rahman to demand that Singapore withdraw from Malaysia. Despite last-ditch attempts by Singaporean leaders to keep Singapore as a part of the Federation, on 9 August 1965 the Malaysian Parliament voted 126–0 in favour of the expulsion of Singapore.

The most vexed issues of independent Malaysia were education and the disparity of economic power among the ethnic communities. The Malays felt unhappy with the wealth of the Chinese community, even after the expulsion of Singapore. Malay political movements emerged based around this. However, since there was no effective opposition party, these issues were contested mainly within the coalition government, which won all but one seat in the first post-independence Malayan Parliament. The two issues were related since the Chinese advantage in education played a large part in maintaining their control of the economy, which the UMNO leaders were determined to end. The MCA leaders were torn between the need to defend their own community's interests and the need to maintain good relations with UMNO. This produced a crisis in the MCA in 1959, in which a more assertive leadership under Lim Chong Eu defied UMNO over the education issue, only to be forced to back down when Tunku Abdul Rahman threatened to break up the coalition.

The Education Act of 1961 put UMNO's victory on the education issue into legislative form. Henceforward Malay and English would be the only teaching languages in secondary schools, and state primary schools would teach in Malay only. Although the Chinese and Indian communities could maintain their own Chinese and Tamil-language primary schools, all their students were required to learn Malay, and to study an agreed "Malayan curriculum". Most importantly, the entrance exam to the University of Malaya (which moved from Singapore to Kuala Lumpur in 1963) would be conducted in Malay, even though most teaching at the university was in English until the 1970s. This had the effect of excluding many Chinese students. At the same time, Malay schools were heavily subsidised, and Malays were given preferential treatment. This obvious defeat for the MCA greatly weakened its support in the Chinese community.

As in education, the UMNO government's unspoken agenda in the field of economic development aimed to shift economic power away from the Chinese and towards the Malays. The two Malayan Plans and the First Malaysian Plan (1966–1970) directed resources heavily into developments that would benefit the rural Malay community. Several agencies were set up to enable Malay smallholders to upgrade their production and to increase their incomes. The Federal Land Development Authority (FELDA) helped many Malays to buy or upgrade farms. The state also provided a range of incentives and low-interest loans to help Malays start businesses, and government tendering systematically favoured Malay companies, leading many Chinese-owned businesses to "Malayanise" their management.

Crisis of 1969 and Communist insurgency
The collaboration of the MCA and the MIC in these policies weakened their hold on the Chinese and Indian electorates. At the same time, the effects of the government's affirmative action policies of the 1950s and 1960s had been to create a discontented class of educated but underemployed Malays. This led to the formation of a new party, the Malaysian People's Movement (Gerakan Rakyat Malaysia) in 1968. Gerakan was a deliberately non-communal party, bringing in Malay trade unionists and intellectuals as well as Chinese and Indian leaders. At the same time, an Islamist party, the Islamic Party of Malaysia (PAS) and a Democratic socialist party, the Democratic Action Party (DAP), gained increasing support, at the expense of UMNO and the MCA respectively.

Following the end of the Malayan Emergency, the predominantly ethnic Chinese Malayan National Liberation Army, the armed wing of the Malayan Communist Party, had retreated to the Malaysian-Thailand border where it had regrouped and retrained for future offensives against the Malaysian government. The insurgency officially began when the MCP ambushed security forces in Kroh–Betong, in the northern part of Peninsular Malaysia, on 17 June 1968. Instead of declaring a "state of emergency" as the British had done previously, the Malaysian government responded to the insurgency by introducing several policy initiatives including the Security and Development Program (KESBAN), Rukun Tetangga (Neighbourhood Watch), and the RELA Corps (People's Volunteer Group).

At the May 1969 federal elections, the UMNO-MCA-MIC Alliance polled only 48% of the vote, although it retained a majority in the legislature. The MCA lost most of the Chinese-majority seats to Gerakan or DAP candidates. A Malay backlash resulted, leading rapidly to riots and inter-communal violence in which about 6,000 Chinese homes and businesses were burned and at least 184 people were killed, although Western diplomatic sources at the time suggested a toll of close to 600, with most of the victims are Chinese. The government declared a state of emergency, and a National Operations Council, headed by Deputy Prime Minister Tun Abdul Razak, took power from the government of Tunku Abdul Rahman, who, in September 1970, was forced to retire in favour of Abdul Razak.

Using the Emergency-era Internal Security Act (ISA), the new government suspended Parliament and political parties, imposed press censorship and placed severe restrictions on political activity. The ISA gave the government power to intern any person indefinitely without trial. These powers were widely used to silence the government's critics, and have never been repealed. The Constitution was changed to make illegal any criticism, even in Parliament, of the Malaysian monarchy, the special position of Malays in the country, or the status of Malay as the national language.

In 1971, the Parliament reconvened, and a new government coalition, the Barisan Nasional, was formed in 1973 to replace the Alliance party. Abdul Razak held office until he passed away in 1976. On July 16, 1981, Malaysia ushered in Mahathir Mohamad, the longest-serving Prime Minister. He ruled the country for a total of 22 years. During this period, he led the rapid economic development of Malaysia and the construction of many large-scale projects.

During these years policies were put in place which led to the rapid transformation of Malaysia's economy and society, such as the controversial New Economic Policy, which was intended to increase proportionally the share of the economic "pie" of the bumiputras as compared to other ethnic groups—was launched by Prime Minister Tun Abdul Razak. Malaysia has since maintained a delicate ethno-political balance, with a system of government that has attempted to combine overall economic development with political and economic policies that promote equitable participation of all races.

Modern Malaysia
In 1970 three-quarters of Malaysians living below the poverty line were Malays, the majority of Malays were still rural workers, and Malays were still largely excluded from the modern economy. The government's response was the New Economic Policy of 1971, which was to be implemented through a series of four five-year plans from 1971 to 1990. The plan had two objectives: the elimination of poverty, particularly rural poverty, and the elimination of the identification between race and prosperity. This latter policy was understood to mean a decisive shift in economic power from the Chinese to the Malays, who until then made up only 5% of the professional class. To provide jobs for all these new Malay graduates, the government created several agencies for intervention in the economy. The most important of these were PERNAS (National Corporation Ltd.), PETRONAS (National Petroleum Ltd.), and HICOM (Heavy Industry Corporation of Malaysia), which not only directly employed many Malays but also invested in growing areas of the economy to create new technical and administrative jobs which were preferentially allocated to Malays. As a result, the share of Malay equity in the economy rose from 1.5% in 1969 to 20.3% in 1990.

Mahathir administration
Mahathir Mohamad was sworn in as prime minister on 16 July 1981. One of his first acts was to release 21 detainees held under the Internal Security Act. He appointed Musa Hitam as deputy prime minister.

The expiry of the Malaysian New Economic Policy (NEP) in 1990 allowed Mahathir to outline his economic vision for Malaysia. In 1991, he announced Vision 2020, under which Malaysia would aim to become a fully developed country within 30 years. The target would require average economic growth of approximately seven per cent of the gross domestic product per annum. Vision 2020 was accompanied by the NEP's replacement, the National Development Policy (NDP), under which some government programs designed to benefit the Bumiputera exclusively were opened up to other ethnicities. The NDP achieved success in one of its main aims, poverty reduction. By 1995, less than nine per cent of Malaysians lived in poverty, and income inequality had narrowed. Mahathir's government cut corporate taxes and liberalised financial regulations to attract foreign investment. The economy grew by over nine per cent per annum until 1997, prompting other developing countries to emulate Mahathir's policies.

Mahathir initiated a series of major infrastructure projects in the 1990s. One of the largest was the Multimedia Super Corridor, an area south of Kuala Lumpur, in the mould of Silicon Valley, designed to cater for the information technology industry. Other Mahathir's projects included the development of Putrajaya as the home of Malaysia's public service and bringing a Formula One Grand Prix to Sepang. One of the most controversial developments was the Bakun Dam in Sarawak. The ambitious hydroelectric project was intended to carry electricity across the South China Sea to satisfy electricity demand in Peninsular Malaysia. Work on the dam was eventually suspended due to the Asian financial crisis. In 1997, the Asian financial crisis threatened to devastate Malaysia. The value of the ringgit plummeted due to currency speculation, foreign investment fled, and the main stock exchange index fell by over 75%. At the urging of the International Monetary Fund (IMF), the government cut government spending. It raised interest rates, which only served to exacerbate the economic situation. In 1998, in a controversial approach, Mahathir increased government spending and fixed the ringgit to the US dollar. Malaysia recovered from the crisis faster than its Southeast Asian neighbours.

In the domestic sphere, it was a political triumph. Anwar Ibrahim and his supporters initiated the Reformasi movement. It consisted of several mass demonstrations and rallies against the long-standing Barisan Nasional coalition government. He was jailed in April 1999 after a trial for sodomy that was criticised by human rights groups and several foreign governments.

Having spent over 22 years in office, Mahathir was the world's longest-serving elected leader when he retired in October 2003.

Abdullah administration
Abdullah Ahmad Badawi promised to combat corruption when he became the fifth Prime Minister, thus empowering anti-corruption agencies and providing more avenues for the public to expose corrupt practices. He advocated an interpretation of Islam known as Islam Hadhari, which advocates the intercompatibility between Islam and economic and technological development. His administration also placed a strong emphasis on reviving Malaysia's agriculture industry and ensuring the country's food security. At the 2004 general election, the Barisan Nasional led by Abdullah Badawi had a massive victory.

Sheikh Muszaphar Shukor, a Malaysian orthopedic surgeon, became the first Malaysian astronaut to travel to space aboard the Russian spacecraft Soyuz TMA-11 on October 10, 2007. This mission marked a notable achievement in Malaysia's space exploration endeavors.

In November 2007, Malaysia saw two anti-government rallies. The 2007 Bersih Rally was held in Kuala Lumpur on 10 November 2007, to campaign for electoral reform. It was precipitated by allegations of corruption and discrepancies in the Malaysian election system that heavily favoured the ruling political party, Barisan Nasional. Another rally was held in the same month, on 25 November 2007, in Kuala Lumpur led by Hindu Rights Action Force (HINDRAF) over alleged discriminatory policies favouring ethnic Malays. On 15 October 2008, HINDRAF was banned when the government labelled the organisation as a threat to national security.

Abdullah Badawi was re-elected as the prime minister in the 2008 general election. Abdullah came under growing criticism, primarily because of his failure to combat corruption and his subpar performance in the election. Hence, in October 2008, he announced his intention to resign. Abdullah was succeeded in office by his deputy, Najib Razak (son of Abdul Razak), in April 2009.

Najib administration
1Malaysia campaign was introduced by Najib Razak in the summer of 2009.

On 15 September 2011, Najib announced that the Internal Security Act 1960 will be repealed and replaced by two new laws. The ISA was replaced and repealed by the Security Offences (Special Measures) Act 2012 which has been passed by Parliament and given royal assent on 18 June 2012. The Act came into force on 31 July 2012. Najib's government came under criticism after SOSMA was misused to unfairly detain dissidents.

In early February 2013, there was an incursion in Lahad Datu, a military conflict that began when hundreds of militants, some of whom were armed, arrived by boats in Lahad Datu District, Sabah, Malaysia from Simunul Island, Tawi-Tawi, in the southern Philippines. The group was sent by Jamalul Kiram III, one of the claimants to the throne of the Sultanate of Sulu. In response to the incursion, Malaysian security forces launched a major operation to repel the militants, resulting in a decisive Malaysian victory which ended the conflict in late March 2013. Following the elimination of militants, the Eastern Sabah Security Command (ESSCOM) was established. On March 8, 2014, Malaysia Airlines Flight 370 vanished en route from Kuala Lumpur to Beijing. Just four months later, 298 people were killed when Malaysia Airlines Flight 17 was shot down by a surface-to-air missile while flying over territory controlled by Russian-backed militants in Eastern Ukraine.

On 1 April 2015, Najib passed a controversial 6 per cent tax on goods and services. Later that year, his administration was engulfed in scandal when Najib and other officials were implicated in a multibillion-dollar embezzlement and money-laundering scheme involving 1Malaysia Development Berhad (1MDB), a state-owned investment fund masterminded by Low Taek Jho, triggering widespread calls and protests from most Malaysians including the opposition parties for Najib's resignation. These protests culminated in the Malaysian Citizens' Declaration.

The Bersih movement also held four rallies from 2011 to 2016 during the Najib administration intending to reform Malaysia's electoral system. The movement expanded its demands to include issues such as clean governance and human rights. In response to accusations of corruption, Najib tightened his hold on power by removing Muhyiddin Yassin, the deputy prime minister at the time, suspending two newspapers, and forcing through the parliaments the controversial National Security Council Bill, which gives the prime minister unprecedented powers. Living costs have skyrocketed as a result of Najib's numerous subsidy cuts, while the Malaysian ringgit declined. After Barisan Nasional lost the 2018 general elections, these came to an end.

Relations between Malaysia and North Korea deteriorated in 2017, in the aftermath of the assassination of Kim Jong-nam in Malaysia, which made global headlines and sparked a major diplomatic row.

Second Mahathir administration
Mahathir Mohamad was sworn in as the seventh Prime Minister after winning the election on 10 May 2018. A number of issues contributed to Najib Razak's defeat, including the ongoing 1Malaysia Development Berhad (1MDB) scandal, the 6% Goods and Services Tax, and the rising cost of living.

Mahathir promised to "restore the rule of law", and conduct elaborate and transparent investigations into the 1Malaysia Development Berhad scandal.

Anwar Ibrahim was given a full royal pardon and was released from prison on 16 May 2018. He was designated to take over the reins from Prime Minister Mahathir Mohamad as planned and agreed by the coalition before GE14. The unpopular tax was reduced to 0% on 1 June 2018. The government under Mahathir tabled the first reading Bill to repeal GST in Parliament on 31 July 2018 (Dewan Rakyat). GST was successfully replaced with Sales Tax and Service Tax starting 1 September 2018.

Mahathir's administration promised to review all Belt and Road Initiative projects in Malaysia that were initiated by the previous government. He characterised these as "unequal treaties" and said some were linked to misappropriated funds from the 1MDB scandal. The government suspended work on the East Coast Rail Link and continued it after terms had been renegotiated. Mahathir cancelled approximately $2.8 billion worth of deals with China Petroleum Pipeline Bureau altogether, stating that Malaysia would not be able to repay its obligations to China.

Mahathir was supportive of the 2018–19 Korean peace process and announced that Malaysia would reopen its embassy in North Korea and resume relations.

On 28 September 2018, Mahathir addressed the United Nations General Assembly, stating that his government would promise to ratify the International Convention on the Elimination of All Forms of Racial Discrimination (ICERD). However, after weeks of receiving racially and religiously charged demonstrations against the convention, particularly from Bumiputras, the Pakatan Harapan government chose not to accede to the ICERD on 23 November 2018.

Mahathir announced the Shared Prosperity Vision 2030 in October 2019, which aimed to increase the incomes of all ethnic groups, focus more on the technology sector, and for Malaysia to become a high-income country by 2030.

Malaysia's freedom of the press improved slightly under Mahathir's tenure, and the country's rank rose in the Press Freedom Index.

Political infightings within the Pakatan Harapan coalition, as well as the uncertainty of the date of the transition of power to his designated successor, Anwar Ibrahim, soon culminated in a political crisis known as the Sheraton Move in February 2020.

Muhyiddin administration
On 1 March 2020, a week after the country was thrown into a political crisis, Muhyiddin Yassin was appointed as the eighth Prime Minister by the Yang di-Pertuan Agong, following the abrupt resignation of Mahathir Mohamad. The fallen government was replaced by the new Perikatan Nasional (PN) coalition government, led by BERSATU leader Muhyiddin.

During his administration, COVID-19 spread throughout the nation. In response, Muhyiddin implemented the Malaysian movement control order (MCO) on 18 March 2020.

On 28 July 2020, the High Court convicted former Prime Minister Najib Razak of abuse of power, money laundering and criminal breach of trust, becoming the first Prime Minister of Malaysia to be convicted of corruption. After failing several appeals, he entered Kajang Prison on August 23, 2022 to serve his sentence.

In mid-January 2021, the Yang di-Pertuan Agong declared a national state of emergency until at least 1 August in response to the COVID-19 crisis and political infighting. Parliament and elections were suspended while the Malaysian government was empowered to introduce laws without approval.

Muhyiddin commenced the country's vaccination programme against COVID-19 in late February 2021.

On 19 March 2021, North Korea announced the severance of diplomatic ties with Malaysia, after the Kuala Lumpur High Court rejected North Korean businessman Mun Chol Myong's appeal from extradition to the United States.

Muhyiddin officially resigned as prime minister on August 16, 2021, after losing the majority in parliament support due to the country's political crisis, as well as calls for his resignation due to economic stagnation and the government's failure to prevent COVID-19 infections and deaths. He was afterwards appointed back as caretaker Prime Minister by the Yang di-Pertuan Agong until a replacement can be selected.

Ismail Sabri administration
Ismail Sabri Yaakob was sworn in as the ninth Prime Minister on August 21, 2021. During his inaugural speech as prime minister on 22 August 2021, Ismail Sabri introduced the Keluarga Malaysia idea. During his tenure, he lifted the Movement Control Order (MCO) following the expansion of the vaccination programme and oversaw the Twelfth Malaysia Plan.

In late 2022, a constitutional amendment was passed, that prohibits members of parliament from switching political parties. Several UMNO lawmakers called for a snap election before the end of 2022 to resolve ongoing infighting in the party and obtain a stronger mandate. This led to an earlier general election in November 2022, which resulted in a hung parliament, the first federal election to have such a result in the nation's history.

Anwar administration
Anwar Ibrahim, the chairman of Pakatan Harapan (PH), was appointed and sworn in as the 10th Prime Minister on 24 November 2022 by the Yang di-Pertuan Agong as Anwar has obtained support for a grand coalition government.

Anwar Ibrahim launched the Malaysia Madani concept as a national policy on January 19, 2023, in Putrajaya which replaced the Keluarga Malaysia concept from the previous administration of Ismail Sabri Yaakob.

title: History of Malaysia