Singapore was one of the 13 states of Malaysia from 1963 to 1965. Malaysia was formed on 16 September 1963 as a new political entity from the merger of the Federation of Malaya with former British colonies of North Borneo, Sarawak and Singapore. This marked the end of a 144-year period of British rule in Singapore, beginning with the founding of modern Singapore by Sir Stamford Raffles in 1819.
The union, however, was unstable due to distrust and ideological differences between leaders of the State of Singapore and the federal government of Malaysia. Such issues resulted in frequent disagreements relating to economics, finance and politics. The United Malays National Organisation (UMNO), which was the political party in power in the federal government, saw the participation of the Singapore-based People's Action Party (PAP) in the Malaysian general election of 1964 as a threat to its Malay-based political system. There were also major racial riots that year involving the majority Chinese community and the Malay community in Singapore. During a 1965 Singaporean by-election, UMNO threw its support behind the opposition Barisan Sosialis candidate. In 1965, Malaysian Prime Minister Tunku Abdul Rahman decided upon the expulsion of Singapore from the Federation, leading to the independence of Singapore on 9 August 1965.
Racial tensions increased dramatically within a year. They were fuelled by the Barisan Sosialis's tactics of stirring up communal sentiment as the pro-Communist party sought to use means to survive against the crackdown by both the government of Singapore and the Federal Government. In particular, despite the Malaysian government conceding citizenship to the many Chinese immigrants after independence, in Singapore the Chinese disdained the Federal policies of affirmative action, which granted special privileges to the Malays guaranteed under Article 153 of the Constitution of Malaysia. These included financial and economic benefits that were preferentially given to Malays and the recognition of Islam as the sole official religion, although non-Muslims maintained freedom of worship.
Malays and Muslims in Singapore were being increasingly incited by the Federal Government's accusations that the PAP was mistreating the Malays. Numerous racial riots resulted, and curfews were frequently imposed to restore order. The external political situation was also tense at the time, with Indonesia actively against the establishment of the Federation of Malaysia. President Sukarno of Indonesia declared a state of Konfrontasi (Confrontation) against Malaysia and initiated military and other actions against the new nation, including the bombing of MacDonald House in Singapore in March 1965 by Indonesian commandos which killed three people. Indonesia also conducted seditious activities to provoke the Malays against the Chinese. One of the more notorious riots was the 1964 race riots that took place on Prophet Muhammad's birthday on 21 July, near Kallang Gasworks; twenty-three were killed and hundreds injured. More riots broke out in September 1964. The price of food skyrocketed when the transport system was disrupted during this period of unrest, causing further hardship. The Singapore Government later named 21 July each year as Racial Harmony Day.
The Federal Government of Malaysia, dominated by the United Malays National Organisation (UMNO), was concerned that as long as Singapore remained in the Federation, the bumiputera policy of affirmative action for Malays and the indigenous population would be undermined and therefore run counter to its agenda of addressing economic disparities between racial groups. One of the major concerns was that the PAP continued to ignore these disparities in their repeated pledges for a "Malaysian Malaysia" – the equal treatment of all races in Malaysia by the government which should serve Malaysian citizens without any regard for the economic conditions of any particular race. Another contributor was the fear that the economic dominance of Singapore's port would inevitably shift political power away from Kuala Lumpur in time, should Singapore remain in the Federation.
The state and federal governments also had disagreements on the economic front. Despite an earlier agreement to establish a common market, Singapore continued to face restrictions when trading with the rest of Malaysia. In retaliation, Singapore did not extend to Sabah and Sarawak the full extent of the loans agreed to for economic development of the two eastern states. The situation escalated to such an intensity that talks soon broke down and abusive speeches and writing became rife on both sides. UMNO extremists called for the arrest of Lee Kuan Yew.
On 7 August 1965, Prime Minister Tunku Abdul Rahman, seeing no alternative to avoid further bloodshed, advised the Parliament of Malaysia that it should vote to expel Singapore from Malaysia. Despite last-ditch attempts by PAP leaders, including Lee Kuan Yew, to keep Singapore as a state in the union, the Parliament on 9 August 1965 voted 126–0 in favor of the expulsion of Singapore, with Members of Parliament from Singapore not present. On that day, a tearful Lee announced that Singapore was a sovereign, independent nation and assumed the role of Prime Minister of the new nation. His speech included this quote: "For me it is a moment of anguish because all my life….you see the whole of my adult life…. I have believed in merger and the unity of these two territories. You know it's a people connected by geography, economics, and ties of kinship... ."
Under constitutional amendments passed in December that year, the new state became the Republic of Singapore, with Yang di-Pertuan Negara becoming President, and the Legislative Assembly becoming the Parliament of Singapore. These changes were made retroactive to the date of Singapore's separation from Malaysia. The Malaya and British Borneo dollar remained legal tender until the introduction of the Singapore dollar in 1967. Before the currency split, there were discussions about a common currency between the Malaysian and Singaporean Governments.