The early history of Negeri Sembilan saw the migration of the Minangkabau people from the island of Sumatra to the west coast of the Malay Peninsula during the sixteenth and seventeenth centuries. These people settled mainly in Naning, Sungai Ujong and Rembau. By the mid-nineteenth century, they had formed a loose coalition of nine states, each with their own leader, with the head of the coalition rotating among the nine chiefs. (Malaysia has adopted this system for the appointment of the Yang Dipertuan Agong or King.)
Naning, Sungai Ujong and Rembau lay within the Johor-Riau Empire and were placed under a head called Datuk who was appointed to oversee the territory.
In 1770, the disintegration of the Johor-Riau Empire and the rise of the Bugis Sultanate in Selangor precipitated insurrections in Rembau, Sungai Ujong, Johol and Ulu Muar. The Minangkabaus then turned to the Pagar Ruyong royal house in Sumatra for a ruler who could protect them. Consequently, Raja Melewar was proclaimed the first Yang Dipertuan Besar of Negeri Sembilan in 1773.
The problems in Negeri Sembilan posed a threat to the tin trade with the Straits Settlements. This led to British intervention and subsequently Martin Lister was appointed as the first British Resident of Negeri Sembilan.
Later, the Resident system proved ineffectual and Sir Frank Swettenham initiated the proposal of a federation of states. With consensus of the sultans, the agreement was ratified in 1896. Selangor, Perak, Pahang and Negeri Sembilan were united under a central administration. They were to be known as the Federated Malay States (FMS) and administered by a Resident-General, thus becoming a British protectorate. Swettenham was appointed the first Resident-General of the FMS.
The FMS continued until the Japanese invasion in 1941. After the surrender of the Japanese, Negeri Sembilan was placed under the British Military Administration from September 1945 to early 1946.
As early as 1943, plans for a Malayan Union were being discussed in London. On 10 October 1945, it was presented in the British Parliament. According to the plan, Penang, Malacca and the 9 other Malay states were to be united under a Malayan Union. Sir Harold MacMichael was despatched to obtain the agreement of the Malay rulers. However, Malay opposition derailed the plan. The Malays united under the leadership of Dato’ Onn Jaafar to form the United Malays National Organisation (UMNO) on 11 May 1946. Two years later, the Federation of Malaya was established on 1 February 1948 and Malaya achieved independence from the British on 31 August 1957.