thumb|The [[Gombak River in Kuala Lumpur in 1900]]
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 own history. Significant events in Malaysia's modern history include the formation of the federation, the separation of Singapore, the racial riots, Mahathir Mohamad's era of industrialisation and privatisation, and the nation's political upheavals of the late 20th and early 21st centuries.
The first evidence of archaic human occupation in the region dates back at least 1.83 million years, while the earliest remnants of anatomically modern humans are approximately 40,000 years old. The ancestors of the present-day population of Malaysia entered the area in multiple waves during prehistoric 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, leading to the rise of several sultanates, the most prominent being 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 in 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 17th to 18th centuries, with the Dutch 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 marked by 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 Japanese Empire was defeated by the Allies, the Malayan Union was established in 1946 and reorganized as the Federation of Malaya in 1948. In the peninsula, the Malayan Communist Party (MCP) took up arms against the British, leading 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, but in August 1965, Singapore was expelled from the federation and became a separate independent country. A racial riot in 1969 resulted in 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, Malaysia experienced rapid economic growth and urbanization beginning in the 1980s. The National Development Policy (NDP), succeeding the previous economic policy, was implemented from 1991 to 2000. The 1997 Asian financial crisis nearly caused the country's currency, stock, and property markets to collapse, though they subsequently recovered. The 1MDB scandal came to prominence in 2015 as a significant global corruption scandal, implicating then-Prime Minister Najib Razak. The scandal significantly influenced the 2018 general election, resulting in the first change of ruling political party since independence. In early 2020, Malaysia faced a political crisis, The 2022 general election resulted in Malaysia's first hung parliament, leading to Anwar Ibrahim's appointment as Prime Minister on November 24, 2022.
Prehistory
thumb|alt=Niah Skull|The discovery of a skull estimated to be around 40,000 years old in the [[Niah National Park|Niah Caves, in Sarawak, has been identified as the earliest evidence for human settlement in Malaysian Borneo (photo December 1958).]]thumb|The Malay Peninsula, shown in the Ptolemy's map as the [[Golden Khersonese]]
Stone hand axes from early hominids, probably Homo erectus, have been unearthed in Lenggong. These axes date back 1.83 million years, making them some of the oldest evidence of hominid habitation in Southeast Asia.
The earliest evidence of modern human habitation in Malaysia is a 40,000-year-old skull excavated from the Niah Caves in present-day Sarawak. This skull is also one of the oldest modern human remains found in Southeast Asia. The first foragers visited the West Mouth of the Niah Caves, located 110 kilometers (68 miles) 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 discovered in the area. The region around the Niah Caves has been designated as Niah National Park. ]]
A study of Asian genetics suggests that the original humans in East Asia came from Southeast Asia. The oldest complete skeleton found in Malaysia is the 11,000-year-old Perak Man, unearthed in 1991. Indigenous groups on the peninsula (known as the Orang Asli) can be divided into three ethnicities: the Negritos, the Senoi, and the Proto-Malays. The first inhabitants of the Malay Peninsula were most likely Negritos. These Mesolithic hunters were probably the ancestors of the Semang, an ethnic Negrito group. The Semang populations on the coast died out in the 20th century but there are still groups living in the interior of the Peninsula.
The Senoi appear to be a composite group, with approximately half of their 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 technology to the southern part of the peninsula approximately 4,000 years ago. They eventually 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 of Maritime Southeast Asia, some also have 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, a trading network that existed for 3,000 years, between 2000 BC and 1000 AD.
Anthropologists support the notion that the Proto-Malays originated from what is today Yunnan, China. 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 Deutero-Malays, the first group in the peninsula to use metal tools, were direct ancestors of modern Malaysian Malays and introduced advanced farming techniques.
Early Hindu-Buddhist kingdoms
thumb|250x250px|Historic [[Indosphere cultural influence zone of Greater India for transmission of religion, music, arts, and cuisine]]
In the first millennium AD, the 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.
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)
thumb|200px|The Buddha-Gupta stone, dating to the 4th–5th century AD, was dedicated by an Indian Merchant, Buddha Gupta. Found in Seberang Perai and kept in the National Museum, Calcutta, India.
There were as many as 30 Malay kingdoms in the 2nd and 3rd centuries, mainly based on the eastern side of the Malay Peninsula. 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
thumb|Built in the 6th century AD, Candi Bukit Batu Pahat is the most well-known ancient Hindu temple found in Bujang Valley.
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 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
thumb|Bronze Avalokiteshvara statue found in Perak, 8th–9th century
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.
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
thumb|The earliest record of a local law influenced by Islamic teaching and written in [[Jawi (script)|Jawi. The stone monument is found in Terengganu.]]
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.
thumb|The Zheng He monument, today, marks his stopover at the city. 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. 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. Due to Chinese involvement, Malacca had grown as a key alternative to other important and established ports.
