Singapore was a Malay trading center as early as the 12th century, when it was a part of an empire based on Sumatra. The city was leveled by Javanese invaders in 1376. The site remained uninhabited until 1819, when Thomas Stamford Raffles, an agent of the British East India Company, leased it from a Malay sultan and founded a trading post. In 1824 the island was ceded to the company, which in 1829 made it part of the Straits Settlements (the company's possessions in Malaya). In 1867 the Straits Settlements became a British crown colony.

Important dates in Singapore
1349 Chinese trader and author Wang Dayuan wrote an account of his visit to the island of Singapore.
1819 Sir Thomas Stamford Raffles, an official of the British East India Company, established the first permanent settlement at Singapore.
1822 Raffles designed a town plan for Singapore, granting each of the major ethnic groups a kampong (village section).
1826 Singapore united with Melaka and Penang to form the Presidency of the Straits Settlements, ruled by British administrators.
1867 The Straits Settlements became a British crown colony.
1869-1879 Singapore's shipping trade quadrupled following the opening of the Suez Canal in 1869.
1877 The British government established the Chinese Protectorate. William Pickering was appointed as the first protector.
1942 The Japanese captured Singapore during World War II and held it until 1945.
1946 Singapore became a separate crown colony of the United Kingdom.
1955 Singapore's first legislative assembly was established.
1959 Singapore became self-governing, though the United Kingdom retained control of defense and foreign affairs. Lee Kuan Yew became prime minister.
1963 Singapore joined the Federation of Malaysia but withdrew two years later.
1965 Singapore became a fully independent member of the Commonwealth of Nations.
1971 The last British troops left Singapore.
1993 Ong Teng Cheong became Singapore's first directly elected president.

Throughout the 19th century Singapore flourished because of its strategic location as a transshipment center for goods. Steady immigration, mainly from China, swelled the population, and Singapore became one of the largest Chinese cities outside China. After World War I, the British made the colony an important naval base. In World War II the strongly fortified city easily fell to the Japanese, who attacked from the land side. (The large guns intended to defend the city could only be fired seaward.) In 1946 the British made Singapore a separate crown colony upon the dissolution of the Straits Settlements.

In 1959 Singapore was given internal self-government. Lee Kuan Yew, leader of the ruling People's Action Party (PAP), became prime minister. Upon gaining independence in 1963, Singapore merged with Malaya, Sarawak, and Sabah to form the Federation of Malaysia. The federation, however, was torn by dissension between its Malay and Chinese populations. In 1965 Singapore seceded and became an independent member in the Commonwealth of Nations. In 1971 the British-Malaysian defense treaty, which provided British troops for Singapore's defense, expired.

Under Lee, Singapore, which had long been dependent on the entrepôt trade and income from British military bases, was extensively industrialized. By the 1980's, he had made Singapore one of the most prosperous nations in Asia. In 1990 Lee stepped down as prime minister and in 1992 he resigned as head of PAP. The financial crisis that began in Thailand in 1997 and that debilitated many economies in Southeast Asia had only a limited impact on Singapore, which had a more fundamentally sound financial sector than its neighbors.

S. R. Nathan became the president of Singapore in 1999 after the other candidates were disqualified. Following the completion of his term in office, he was granted another six-year term as president in 2005. The government of Singapore puts limitations on what its citizens can say. However, in 2000 and 2001, for the first time it allowed people to speak their opinions more freely—at a public park and at an outdoor rally.