The 1365 Javanese epic poem Negarakretagama identified a settlement called Tamasek, Water Town, on Singapore island. Chinese trader, Wany Dayuan, who visited Singapore around 1330 and referred to the settlement as Danmaxi, reported that there were also some Chinese living on the island. The Sejarah Melayu or Malay Annals has the most colorful account of how Singapore got its present name. As the story goes, Sang Mila Utama (or Sri Tri Buana), ruler of Palembang, landed at Temasek one day while seeking shelter from a storm. Sighting an animal that his followers calleda lion, he decided to establish a settlement and named it Singapura - Lion City. The island became commonly known as Singapura by the end of the 14th century.
During the 14th century, Singapore was caught in the struggle between Siam (now Thailand) and the Java-based Majapahit Empire for control over the Malay Peninsula. According to to Sejarah Melayu, Singapore was defeated in one Majapahit attack. Later a prince of Palembang, Iskandar Shah, also known as Parameswara, killed the local chieftain and installed himself as the island's new ruler. Shortly after, he was driven out, either by the Siamese or by the Javanese forces of the Majapahit and fled north to Malacca where he founded the Malacca Sultanate. Singapore remained an important part of the Malacca Sultanate; it was the fief of admirals, including Hang Tuah.
In the early 15th century, Singapore was a Thai vassal state, but the Malacca Sultanate which Iskandar had founded quickly extended its authority over the island. After the Portuguese seizure of Malacca in 1511, the Malay admiral fled to Singapura and established a new capital at Johor Lama, keeping a port officer in Singapura. The Portuguese destroyed Johor Lama in 1587 and the subsequent obscurity of Singapura probably dates from 1613 when the Portuguese reported burning down a Malay outpost at the mouth of the river.
In 1819, Singapore was established as a trading station by Sir Stamford Raffles under an agreement between the British East India Company and the Sultan of Johor and the Malay ruler of the island. In 1824, Singapore was ceded in perpetuity to the East India Company by the Sultan.
During World War II, Singapore was occupied by the Japanese from 1942 to 1945. Following the surrender of Japan, Singapore was re-occupied by the Allied Forces.
In August 1958, the State of Singapore Act was passed in the United Kingdom Parliament providing for the establishment of the State of Singapore. Singapore achieved internal self-government on 3 June 1959. On 1 September 1962, 73 percent of the electorate voted in favour of merger with Malaysia. Singapore became a part of the Federation of Malaysia on 16 September 1963. The union was short-lived and Singapore separated from Malaysia on 9 August 1965 becoming a fully independent and sovereign nation.
Singapore became the 117th member of the United Nations on 21 September 1965. On 22 December 1965, the Constitution Amendment Act was passed under which the Head of State became the President and the State of Singapore became the Republic of Singapore.
[Information provided by the Singapore Embassy]