British governor Stamford Raffles arrived in Singapore on 28 January 1819 and quickly identified the island as an ideal location for a new port. At the time, Singapore had a population of about 150, including 120 Malays and the remainder Chinese. Although the island was nominally governed by Tengku Abdul Rahman, Sultan of Johor, he was under the influence of the Dutch and the Bugis. The Sultanate was weakened by internal divisions: Abdul Rahman, the Temenggong of Johor, and his officials supported the Sultan’s elder brother, Tengku Long, who was exiled on Penyengat Island in the Riau Islands. With the Temenggong’s assistance, Raffles arranged for Tengku Long to return secretly to Singapore. Raffles offered to recognise him as the rightful Sultan of Johor, under the name Sultan Hussein, and to pay him $5,000 annually, with a further $3,000 for the Temenggong. In exchange, Sultan Hussein would grant the British permission to establish a trading post on Singapore. The Treaty of Singapore was signed on 6 February 1819.
In 1824, a further agreement with the Sultan brought the entire island under the British Empire. Singapore became part of the Straits Settlements in 1826, under the administration of British India, and was named the regional capital in 1836. Before Raffles arrived, the island had only about a thousand inhabitants, mostly Indigenous Malays and a small number of Chinese. By 1860, its population had grown to more than 80,000, over half of whom were Chinese. Many of the early immigrants worked on pepper and gambier plantations. In 1867, the Straits Settlements were detached from British India and placed under Britain’s direct control. Later, during the 1890s, the growth of the rubber industry in Malaya and Singapore established the island as an international centre for rubber sorting and export.

Singapore was largely unaffected by the First World War (1914–1918), since the fighting did not extend to Southeast Asia. The war’s sole major incident there was the 1915 Singapore Mutiny, when Muslim sepoys from British India, stationed in Singapore, rebelled after hearing rumours that they would be sent to fight the Ottoman Empire, a Muslim state. They killed their officers and several British civilians before non-Muslim troops arriving from Johore and Burma put down the uprising.
Following the war, Britain constructed the Singapore Naval Base as a major component of its defence strategy for the territory. First announced in 1921, work progressed slowly until Japan invaded Manchuria in 1931. The base cost $60 million and remained incomplete in 1938, yet it included the world’s largest dry dock and third-largest floating dock, along with fuel tanks capable of supplying the entire British navy for six months. Its defences included heavy 15-inch (380 mm) naval guns at Fort Siloso, Fort Canning and Labrador, as well as a Royal Air Force airfield at Tengah Air Base. Winston Churchill called it the “Gibraltar of the East,” and military discussions often referred to it simply as “East of Suez.” However, the British Home Fleet was based in Europe, and Britain lacked the resources to build a second fleet to safeguard its interests in Asia. The strategy assumed that the Home Fleet could sail to Singapore quickly in an emergency. When the Second World War began in 1939, however, the fleet was fully occupied defending Britain, leaving Singapore exposed to Japanese invasion.