Thehistory of Sabah can be traced back to about 23–30,000 years ago when evidence suggests the earliest human settlement in the region existed. The history is interwoven with thehistory of Brunei and thehistory of Malaysia, whichSabah was previously part of and is currently part of respectively. The earliest recorded history of Sabah being part of any organisedcivilisation began in the early 15th century during the thriving era of theSultanate of Brunei.[1] Prior to this, early inhabitants of the land lived in predominantlytribal societies, although such tribal societies had continued to exist until the 1900s.[2] The eastern part of Sabah was ceded to theSultan of Sulu by the Sultan of Brunei in 1704 for assisting Brunei in suppressing a revolt, but many sources stated it had not been ceded at all.[3][4] By the late 19th century, both territories previously owned by Sultan of Brunei and Sultan of Sulu was granted to British syndicate and later emerged asBritish North Borneo under the management of theNorth Borneo Chartered Company.[5] Sabah became aprotectorate of theUnited Kingdom in 1888 and subsequently became aCrown colony from 1946 until 1963, during which time it was known asCrown Colony of North Borneo. On 16 September 1963, Sabah merged with Malaya,Sarawak andSingapore (left in 1965) to formMalaysia.

During theLast Glacial Maximum about 20,000 years ago, Sabah and the rest ofBorneo island was connected to mainland Asia in a landmass known as theSundaland. Subsequent deglaciation, which caused global sea level to rise, resulted in the Sundaland being submerged, separating Borneo from the rest of Asia.[6] Earliest human settlement in the region is believed to have dated back about 20,000–30,000 years ago. These early humans are believed to beAustraloid orNegrito people, but the reason for their sudden disappearance is unknown.[7] Stone tools and artefacts have been found inMadai and Baturong caves and in the archaeological site in Lake Tingkayu near the district ofKunak which were estimated to date back from 28,000 to 17,000 years ago. The tools found there were considered advanced for its period.[8] There was evidence of human cave-dwellings around 15,000–6,000 years ago. An ongoing 2012 study byUniversiti Sains Malaysia andSabah State Museum revealed the discovery of stone tools in Mansuli Valley nearLahad Datu believed to be 235,000 years old,[9] and in another site in Kampung Lipasu,Bingkor believed to be at least 200,000 years old.[10][11] These recent findings suggests that human settlement in Sabah and Malaysia have existed much earlier than previously thought, which is about 40,000 years ago inNiah Caves,Sarawak.
The earliest ascertained wave of human migration, believed to beAustronesian, occurred around 5,000 years ago.[7] This wave of migration is believed to represent the time when the indigenoushill people of present-day Sabah had first arrived, namely theMurut,Lundayeh,Kadazan-Dusun andOrang Sungai,[7] while Brunei Malays settlement appeared somewhat later.[12] It is believed that some Australoid or Negrito people have interbred with laterAustronesian migrants and remained in Borneo,[8] while others have migrated to other places such asMelanesia, theLesser Sunda Islands andAustralia continent.[8] Someanthropologists such as S.G. Tan and Thomas R. Williams believe that theAustronesian are more closely related to a number of indigenous groups in thePhilippines andFormosa (Taiwan) than to the indigenous peoples of neighbouring Sarawak andKalimantan,[13] These claims were also supported by the findings ofCharles Hose and William McDougall in their account of the "Pagan Tribes of Borneo".[14]
During the 7th century, a settled community known as Vijayapura, a tributary to theSrivijaya empire, was thought to have been the earliest beneficiary to theBruneian Empire existing around the northeast coast of Borneo,[17] founded by the Funan Prince among the early coastal Dusun people. Another kingdom which was suspected to have existed according to Chinese records beginning the 9th century was P'o-ni, also founded by the ancient Dusun people. It was believed that Po-ni existed at the mouth ofBrunei River and was the predecessor to the Sultanate of Brunei.[18]
The Brunei Annals in 1410 mentioned about a Chinese settlement or province centring in theKinabatangan Valley in the east coast surroundingKinabatangan River founded by a man known asOng Sum Ping. This is consistent with the recent discovery of timbercoffins in the Agop Batu Tulug cave in the Kinabatangan Valley, belong to the Dusun Sukang tribe. The coffins, adorned with carvings believed to resemble similar cultural practices in China andVietnam, are believed to date back from around 700 to 1,000 years ago (11th to 14th century).[19] From the 14th century, theMajapahit empire expanded its influence towards Brunei and most of the coastal region of Borneo.
The Sultanate of Brunei began after the ruler of Brunei embracedIslam, and was established by the Bruneian Murut orLun Bawang; some also suggested the Bisaya (Dusunic speaker) who established the early stage ofBruneian Empire. Some sources indicate that this had occurred around 1365 after the ruler, Awang Alak Betatar, converted into Islam and became known asMuhammad Shah.[20] Other sources suggests that the conversion occurred much later around 1514 to 1521, albeit, under the same person.[18][21] During the same period, trade relations flourished, andintermarriages among the native peoples of Borneo with Chinese and Arab traders became common. The intermixing of blood resulted in a distinct breed both in physical stature and features. Prior to the expansion of the Sultanate of Brunei, most of the coastal region of Borneo then came under the rule of the Bruneian Empire during the reign of the fifth sultan known asBolkiah between 1485 and 1524, with the Sultanate'sthalassocracy extended over Sabah,Sulu Archipelago andManila in the north, andSarawak untilBanjarmasin in the south.[21] This was during the period when the Sultanate was in its 'golden era'.[22]
In 1704, the Sultan of Brunei ceded the northern and eastern portion of Borneo to the Sultanate of Sulu in compensation for the latter's help in settling theBrunei Civil War in the Brunei Sultanate.[3] The Sultan of Brunei continued to loosely govern the west coast of Sabah. ManyBrunei Malays migrated to this region during this period, although the migration has begun as early as the 15th century after the Brunei conquest of the territory.[23] While the thalassocratic Brunei and Sulu sultanates controlled the western and eastern coasts of Sabah respectively, the interior region remained largely independent from either kingdoms.[24] Since the late 18th century, theseafaringBajau-Suluk people also arrived from the Sulu Archipelago and started to settling in the coasts of north and eastern Borneo. It is believed that they were fleeing from the oppression of theSpanish colonies in their region.[25]

In 1761,Alexander Dalrymple, an officer of theBritish East India Company, concluded an agreement with the Sultan of Sulu to allow him to set up a trading post in the region. This plan, together with other attempts to build a settlement and a military station centring onBalambangan Island, proved to be a failure.[26] A map by Dalrymple of North Borneo is exhibited in theNational Museum of Scotland. There was minimal foreign interest in this region afterward and control over most parts of north Borneo seems to have remained loosely under the Sultanate of Brunei. In 1846, the island ofLabuan on the west coast of Sabah was ceded to Britain by the Sultan of Brunei and in 1848 it became a British Crown Colony. Labuan became a base for British operations against piracy in the region. The first recorded ascent ofMount Kinabalu, the highest mountain in Borneo, was made in 1851 byBritish Malaya colonial administrator and naturalistHugh Low. The highest peak and the deep gully of the mountain was later named after him.
In 1865, the American Consul General of Brunei,Charles Lee Moses, obtained a 10-year lease over North Borneo from the Sultan of BruneiAbdul Momin. Ownership was then passed to anAmerican Trading Company of Borneo owned byJoseph William Torrey,Thomas Bradley Harris and some Chinese merchants. They set up a base and settlement inKimanis and the Sultan of Brunei appointed Torrey as "The Rajah of Ambong and Marudu". His fortress "Ellena" was located in Kimanis with hundreds of Iban trackers led by Lingkanad. Torrey returned to America in 1877 and died near Boston, Massachusetts, in March 1884. The rights of the trading company were then sold toGustav Baron Von Overbeck, theAustro-Hungarian Consul in Hong Kong (though he was actually a German national), and he later obtained another 10-year renewal of the lease. The lease was subsequently converted into a cession via a treaty which was signed by the Sultan of Brunei Abdul Momin. In the treaty, the Sultan appointed Overbeck as "Maharajah of Sabah and Rajah of Gaya and Sandakan." The treaty granted Overbeck the right over the whole region of Sabah, including the parts purporting to be the dominion of the Sulu Sultanate, as well asSandakan andTawau. The treaty was signed on 29 December 1877 at the Brunei Palace.[27] In 1880, Overbeck offered to trade the territory as apenal colony to theKingdom of Italy, but with pressure from the British, the Italian government refused to the proposal and Britain acquired the region soon after.[28] Similar offer were also made toAustria-Hungary and theGerman Empire.[29]
On the east coast of North Borneo near Sandakan, William Cowie, on behalf of Dent's company,[30] negotiated and obtained aconcession in perpetuity from the Sultan of Sulu over its holdings in this region in 1878. This concession was signed on 22 January 1878 in the palace of the Sultan of Sulu.[31] The concession later became the subject of dispute by the modern republic of the Philippines regarding the historical connection with the eastern part of Sabah. The rights were subsequently transferred toAlfred Dent, who on 26 August 1881 formed theBritish North Borneo Provisional Association Ltd.[21] On 1 November 1881, the British government granted aroyal charter and theBritish North Borneo Chartered Company was subsequently formed.William Hood Treacher was appointed as the first British Governor of North Borneo, withKudat became the first capital.
As the population was too small to fully economically exploit the region, the company brought in Chinese people mainlyHakkas fromGuangdong province to work as labourers in plantation farms. Most of the migrants settled inKudat and Jesselton (nowKota Kinabalu). The capital was moved toSandakan in 1884 to capitalise on its potential of vasttimber resources. In 1885, United Kingdom, Spain and Germany signed theMadrid Protocol of 1885. The purpose of the protocol was to recognise the sovereignty of Spain in theSulu Archipelago and also for Spain to relinquish all claims it might have had over North Borneo.[32]
In 1888, North Borneo became aprotectorate of the United Kingdom. Administration and control over North Borneo remained in the hands of the Company despite being a protectorate and they effectively ruled until 1942. Their rule had been generally peaceful except for some rebellions, including one led by the Bajau-Suluk leaderMat Salleh from 1894 to 1900,[33] and another led byAntanum of theMuruts known as the Rundum resistance in 1915.[34] Many Suluk people had moved to North Borneo during this period due to theSpanish invasion of the Sulu Archipelago.[35] Beginning 1920, more Chinese migrants arrived from the provinces of Guangdong,Fujian and evenHebei after the British changed its immigration policy to stimulate the stagnant economy during that period.[36] There was alsoJavanese migration into North Borneo beginning 1891 and subsequent recruitment of labourers by the British from 1907 onwards.[25] Other significant migrants from present-dayIndonesia into North Borneo consists of theBugis people beginning 1890s[37] and the Florenese people together withTimorese fromFlores andWest andEast Timor respectively beginning in the early 1950s.[38]
The First Native's Paramount Leader was Pehin Orang Kaya-KayaKoroh Santulan of Ansip & Kadalakan, also known as oldKeningau town, "The father of former Sabah State Minister Tan Sri Stephen (Suffian) Koroh, and Sabah's fifth State Governor Tun Thomas (Ahmad) Koroh (the elder brother of Suffian)". Santulan which also a Pengeran, the father to Pehin Orang Kaya-Kaya Koroh was a Murut descendant ofOmar Ali Saifuddin I, the 18th Sultan of Brunei.[citation needed]

As part of the Second World War Japanese forces landed inLabuan on 3 January 1942, and continued to invade the rest of North Borneo. From 1942 to 1945,Japanese forces occupied North Borneo, along with most of the island. Bombings by theallied forces devastated most towns including Sandakan, which was razed to the ground. Resistance against Japanese occupation was concentrated on the west and north coast of North Borneo. The resistance in Jesselton was led byAlbert Kwok andJules Stephens of theKinabalu Guerillas. Another resistance was led by Panglima Alli from Sulug Island, off the coast of Jesselton. InKudat, there was also some resistance led byMustapha Harun. On 10 October 1943, the Kinabalu Guerrillas together with followers of Panglima Alli staged a surprise attack on the Japanese. The attack however was foiled. The 324 local residents who participated in the attacks, including Albert Kwok and Panglima Alli, were detained in Petagas and later executed on 21 January 1944.[39] The site of the execution is today known as thePetagas War Memorial.
InKeningau during World War II, Korom was a rebel and some said he was a Sergeant with theNorth Borneo Armed Constabulary. It was claimed that he spied for the Allied Forces by pretending to be working for the Japanese. He provided intelligence on Japanese positions and some credited him with the escape of 500 Allied POWs. Fighting alongside Korom in his platoon was Garukon, Lumanib, Kingan, Mikat, Pensyl, Gampak, Abdullah Hashim, Ariff Salleh, Langkab, Polos, Nuing, Ambutit, Lakai, Badau and many more including the Chinese.
InSandakan, there was once a brutal POW camp run by the Japanese for British and Australian POWs from North Borneo. The prisoners suffered in agony in their first year of captivity under notoriously inhuman conditions, but much worse was to come through the forced marches of January, March and June 1945 (refer to Sandakan Memorial Park WWII POW Museum Records). Allied bombardments caused the Japanese to relocate the POW camp to inlandRanau, 260 km away. All the prisoners, who by then were reduced to 2,504 in number, were to be moved, but instead of transport, were forced to march the infamousSandakan Death March. Sickness, disease, exhaustion, thirst, hunger, whipping, and shooting killed most of the prisoners, except for six Australians who successfully escaped, were never caught, and survived to tell the horrific story of the death march. The fallen of this march are commemorated each year onAnzac Day (Memorial Day) in Australia and in Sandakan, at the original POW campsite where a POW hut style museum and a black marble memorial obelisk monument are nestled in a peaceful park setting with a lily pond.
The war ended with the official surrender by Lieutenant-GeneralBaba Masao of the 37th Japanese Army in Labuan on 10 September 1945. After the surrender, North Borneo was administered by theBritish Military Administration and in 1946 it became aBritish Crown Colony. Until thePhilippine independence on 1946, seven British-controlled islands in the northern coast of Borneo namedTurtle Islands (includingCagayan de Tawi-Tawi andMangsee Islands) were ceded to the Philippine government by theCrown colony government of North Borneo.[40] Due to massive destruction in the town of Sandakan since the war,Jesselton was chosen to replace the capital with the Crown continued to rule North Borneo until 1963.

On 31 August 1963, North Borneo attained self-government. The idea for the formation of a union of the former British colonies, namely, Malaya, Singapore, Sarawak and North Borneo was mooted as early as the late 19th century, but it wasTunku Abdul Rahman who officially announced the proposal of wider federation in May 1961. It also seemed that this idea was supported by the British.[41] There was a call for complete independence on that date by it was denied by the British Governor who remained in power untilMalaysia Day.[42] In 1962, theCobbold Commission was set up to determine whether the people of Sabah and Sarawak favoured the proposed union. The commission had found that the union was generally favoured by the people but wanted certain terms and conditions incorporated to safeguard the interest of the people. The commission had also noted some opposition from the people but decided that such opposition was minor. The Commission published its report on 1 August 1962 and had made several recommendations. Unlike in Singapore, however, noreferendum was ever conducted in Sabah.[43]
Most ethnic community leaders of Sabah, namely, Mustapha representing the Muslims,Donald Stephens representing the non-Muslim natives, andKhoo Siak Chew representing the Chinese, would eventually support the formation. An agreement was signed by Tunku Abdul Rahman,Harold Macmillan, the British Prime Minister, andWilliam Goode, the lastGovernor of North Borneo, signed on behalf of the territory on 1 August 1962 putting to paper the agreement to form the union. The intention had been to formMalaysia on 31 August 1963 but due to objections from the Philippines and Indonesia, the formation had to be postponed to 16 September 1963. At that point North Borneo, as Sabah, was united with Malaya, Sarawak and Singapore, to formMalaysia.[44][45] To safeguard the interest of North Borneo in the new federation, a20-point agreement was entered into between the federal and the state government.
Leading up to the formation of Malaysia until 1966, Indonesia adopted a hostile policy towards Malaya and subsequently Malaysia, which was backed by British forces. This undeclared war stems from what Indonesian President Sukarno perceive as an expansion of British influence in the region and his intention to wrest control over the whole of Borneo under the Indonesian republic.
Around the same time, there were proposals from certain parties, particularly by theBrunei People's Party, for the formation of aNorth Borneo Federation consisting of Sabah, Sarawak andBrunei. The proposal culminated in rebel attacks in Brunei and some parts of Sabah and Sarawak. The rebellion was foiled by theBruneian Army with the help of the British colonials in December 1962.
The Philippines maintains aterritorial claim over eastern Sabah (formerly known asNorth Borneo) based on an agreement signed in 1878 between the Sultan of Sulu and theNorth Borneo Chartered Company. It maintains the position that the sovereignty of the Sultanate over the territory was not abolished and that North Borneo was onlyleased to the North Borneo Chartered Company.
However, Malaysia considers this dispute as a "non-issue" as it interprets the 1878 agreement as that ofcession and that it deems that the residents of Sabah had exercised their right toself-determination when they joined to form the Malaysian federation in 1963.[47][48]
In early November 2024, Philippine PresidentBongbong Marcos signed thePhilippine Maritime Zones Act and thePhilippine Archipelagic Sea Lanes Act.[49] These laws reaffirmed the Philippines' maritime territories and rights to natural resources across the South China Sea, including Sabah, drawing strong criticism from Malaysia. On 15 November 2024, Kuala Lumpur lodged a diplomatic protest against the two maritime laws, arguing that they infringed upon Malaysia's territorial boundaries in the South China Sea.[50][51]
In March 2025, the Philippines submitted anote verbale to the United Nations, reaffirming that it "has never relinquished its sovereignty" over North Borneo (Sabah). It referenced the 1963Manila Accord as the legal basis for its claim.[52] Malaysia responded in June with a formal protest addressed to UN Secretary-General António Guterres, firmly rejecting the Philippines' partial submission. Kuala Lumpur emphasised that the claim was based on the territorial baselines of Sabah—recognised as part of Malaysia, and declared it unacceptable.[53]
Tun Fuad Stephens became the first chief minister of Sabah. The first Governor (Yang di-Pertuan Negeri) was Mustapha Harun.[54] Sabah held its first state election in 1967. On 6 June 1976, after only 44 days being elected for the second time as chief minister, Tun Fuad Stephens together with other state cabinet ministers died in a plane crash known as theDouble Six Tragedy. He was replaced byHarris Salleh. On 14 June 1976, the government of Sabah signed an agreement withPetronas, the federal government-owned oil and gas company, granting it the right to extract and earn revenue from petroleum found in the territorial waters of Sabah in exchange for 5% in annual revenue asroyalties.[55] Under the leadership of Harris Salleh, the state government of Sabahceded the island ofLabuan and its 6 smaller islands to the Malaysian federal government and it was declared afederal territory on 16 April 1984.[56]
In 1985, following thestate elections,Pairin Kitingan ofParti Bersatu Sabah (PBS) became the seventh chief minister and this marked the second time in Malaysia where a party not affiliated with the national ruling coalitionBarisan Nasional (BN) or its predecessor, theAlliance Party, formed the government in any state (preceded byGerakan inPenang in 1969 and followed byPAS inKelantan in 1990). Along in the same year,Moro pirates attacked Lahad Datu, killing 21 people and injuring 11 others in an event known as the1985 Lahad Datu ambush. In 1986, opponents of the newly elected PBS government startedriots around the state, mainly in the cities ofKota Kinabalu,Tawau andSandakan, resulting in bombings and five fatalities. Peace was gradually restored following asnap election in 1986 which consolidated PBS' position as the ruling state government.[57][58]

From 1990 to 1991, severalPBS politicians were arrested under theInternal Security Act for allegedly being involved in plans for Sabah independence from the Malaysian Federation and detained for two years. Among those arrested wereJeffrey Kitingan andMaximus Ongkili. Other politicians, including Pairin, were hit withcorruption charges. The arrests and charges were suspected to be politically motivated.[59] Following the1994 state election, Barisan Nasional regained control of the state via the creation of the Sabah chapter of theUnited Malays National Organisation (UMNO) party and other parties. Therotation system was introduced by the then prime ministerMahathir Mohamad in which the chief ministerial post would be rotated every two years among the three main communities in Sabah, namely, the Muslim Bumiputeras, non-Muslim Bumiputeras and the Chinese. Sakaran Dandai became the first chief minister under this system in 1994. The rotation system was finally abolished in 2005 with current chief ministerMusa Aman at the helm. On 26 December 1996, Sabah was hit by one of the worst tropical storms,Tropical Storm Greg. The storm hit the western coast of the state resulting in over 200 deaths and thousands of homes destroyed.
In 2000, the state capitalKota Kinabalu was granted city status, making it the 6th city in Malaysia and the first city in the state. Also this year,Kinabalu National Park was officially designated by UNESCO as aWorld Heritage Site, making it the first site in the country to be given such designation. On 3 May, theAbu Sayyaf militant group from the southern Philippines arrived on the resort island ofSipadan andkidnapped 21 people, both tourists and resort workers, for ransom. Most hostages were rescued on 16 September 2000 following an offensive by the Philippine army. In 2002, theInternational Court of Justice ruled that the islands ofLigitan and Sipadan, claimed by Indonesia, are part of Sabah and Malaysia.[60]
In early 2013, an armed group which identified themselves as the "Royal Sulu Army"intruded into Sabah with the purpose ofreclaiming the eastern areas as part of theSultanate of Sulu.[61] This resulted in a standoff and later in an armed conflict between the group and Malaysian security forces which ended with the death of 56 armed group followers and 10 Malaysian security personnel along with 6 civilians.[62] Soon, the state became the main target of criminals andterrorists from the southern Philippines such as Abu Sayyaf and followers of theMoro National Liberation Front underNur Misuari.[63][64] To date, a total of 12 state elections has been held. Sabah has had 14 differentchief ministers and 10 differentYang di-Pertua Negeris.
TheSouth China Sea opened asBorneo moved away fromChina.
Map of British North Borneo, highlighting in yellow colour the area covered by the Philippine claim, presented to the Court by the Philippines during the Oral Hearings at the ICJ on 25 June 2001