The establishment of a British trading post in Singapore in 1819 by Sir Stamford Raffles led to its founding as a British colony in 1824. This event has generally been understood to mark the founding of colonial Singapore, a break from its status as a port in ancient times during the Srivijaya and Majapahit eras, and later, as part of the Sultanate of Malacca and the Johor Sultanate.

Pre-colonial Singapore

A significant port and settlement, known as Temasek, later renamed Singapura, existed on the island of Singapore in the 14th century. Vietnamese records indicate possible diplomatic relationship between Temasek and Vietnam in the 13th century, and Chinese documents describe settlements there in the 14th century. It was likely a vassal state of both the Majapahit Empire and the Siamese at different times in the 14th century. Around the end of the 14th century, its ruler Parameswara was attacked by either the Majapahit or the Siamese, forcing him to move on to Melaka where he founded the Sultanate of Malacca. Archaeological evidence suggests that the main settlement on present-day Fort Canning was abandoned around this time, although a small-scale trading settlement continued in Singapore for some time afterwards. Between the 16th and 19th centuries, the Malay archipelago was gradually taken over by the European colonial powers, beginning with the Portuguese conquest of the Malacca Sultanate in 1511. In 1613, the Portuguese burnt down a trading settlement at the mouth of the Singapore River, after which Singapore lapsed into insignificance in the history of the region for two hundred years.

The early dominance of the Portuguese was challenged during the 17th century by the Dutch, who came to control most of the region's ports. The Dutch established a monopoly over trade within the archipelago, particularly in spices, then the region's most important product. Other colonial powers, including the British, were limited to a relatively minor presence in that period.

Singapore's name comes from 'Singa Pura' which means Lion City in Sanskrit. According to the Sejarah Melayu (Malay Annals), a Sumatran prince called Sang Nila Utama landed on Temasek (Singapore's old name) and saw a Lion which is called 'Singa' in Malay. Thus he gave the island a new name, 'Singapura'.

Raffles' landing and arrival

thumb|upright|Sir Stamford Raffles, founder of modern Singapore

In 1818, Sir Thomas Stamford Raffles was appointed Lieutenant Governor of the British colony at Bencoolen. Raffles believed that the British should find a way to challenge the dominance of the Dutch in the area. The trade route between China and British India passed through the Malacca Strait, and with the growing trade with China, that route would become increasingly important. However, the Dutch had tight control over the trade in the region and intended to enforce the exclusive rights of its company ships to trade, and that trade should be conducted at its entrepot Batavia. British trading ships were heavily taxed at Dutch ports, stifling British trade in the region.

In 1818, Raffles managed to convince Lord Hastings, the then governor-general of India and his superior in the British East India Company, to fund an expedition to establish a new British base in the region, but with the proviso that it should not antagonise the Dutch.

Raffles settled on the island of Singapore because of its position at the southern tip of the Malay peninsula, near the Straits of Malacca, and its excellent natural harbor, fresh water supplies, and timber for repairing ships. Most importantly, it was unoccupied by the Dutch. He found a Malay settlement at the mouth of the Singapore River, headed by Temenggong Abdul Rahman for the Sultan of Johor. The Temenggong had originally moved to Singapore from Johor in 1811 with a group of Malays, and when Raffles arrived, there were an estimated 150 people governed by the Temenggong, most of them Malays, with around 30 Chinese. Although the island was nominally ruled by Johor, the political situation was precarious for the Sultan of Johor at the time. The incumbent Sultan of Johor, Tengku Abdul Rahman, was controlled by the Dutch and the Bugis, and would never agree to a British base in Singapore. However, Abdul Rahman was Sultan only because his older brother, Tengku Hussein, also known as Tengku Long, had been away in Pahang getting married when their father died. Hussein was then living in exile in the Riau Islands.

Singapore Treaty: founding of modern Singapore

With the Temenggong's help, Raffles smuggled Tengku Hussein to Singapore. He offered to recognize Hussein as the rightful Sultan of Johor, and provide him with a yearly payment; in return, Hussein would grant the British East India Company the right to establish a trading post on Singapore. This agreement was ratified with the Treaty of Singapore signed on 6 February 1819. This is recognised as the official founding of modern Singapore and also the beginning as a British settlement.

Early growth (1819–1826)

thumb|Early drawing of the settlement on Singapore as viewed from the sea in 1823. The drawing shows buildings on the High Street with [[Fort Canning Hill known then simply as "The Hill" in the background.]]

Raffles returned to British Bencoolen (Sumatra) the day after the signing of the treaty, leaving Major William Farquhar as the Resident and Commandant of the new settlement, By 1821, the island's population had increased to around five thousand, and the trade volume was $8 million. By 1825, the population had passed the ten thousand mark, with a trade volume of $22 million. (By comparison, the trade volume for the long-established port of Penang was $8.5 million during the same year.) This agreement brought the island squarely under British law, with the proviso that it would take into account Malay customs, traditions and religious practices, "where they shall not be contrary to reason, justice or humanity."

A further treaty, the Treaty of Friendship and Alliance, was arranged by the second Resident John Crawfurd with the Malay chiefs and signed on 2 August 1824 to replace the Singapore Treaty. Singapore, including its nearby islands, was officially fully ceded to the East India Company, and in return, the chiefs would have their debts cancelled and receive an allowance for life, with each given an additional lump sum of 20,000 Spanish dollars.

After installing John Crawfurd, an efficient and frugal administrator, as the new governor, Raffles departed for Britain in October 1823. He would never return to Singapore. Most of his personal possessions were lost after his ship, the Fame, caught fire and sank, and he died only a few years later, in 1826, at the age of 44.

Straits Settlements

The status of Singapore as a British possession was cemented by the Anglo-Dutch Treaty of 1824, which divided the Malay archipelago between the two colonial powers. The area north of the Straits of Malacca, including Penang, Malacca, and Singapore, was designated as the British sphere of influence, while the area south of the Straits was assigned to the Dutch.

This division had far-reaching consequences for the region: modern-day Malaysia and Singapore correspond to the British area established in the treaty, and modern-day Indonesia to the Dutch. In 1826, Singapore was grouped together with Penang and Malacca into a single administrative unit, the Straits Settlements, under the British East India Company.