After Malayan Prime Minister Tunku Abdul Rahman proposed the formation of a federation which would include Malaya, Singapore, Sabah and Sarawak in 1961, Lee began to campaign for a merger with Malaysia to end British colonial rule. He used the results of a referendum held on 1 September 1962, in which 70% of the votes were cast in support of his proposal, to demonstrate that the people supported his plan; most of the other votes were blank, as Lee had not allowed a "No" option.[30]
On 16 September 1963, Singapore became part of Malaysia. However, the union was short-lived. The Malaysian central government, ruled by the United Malays National Organisation (UMNO), became worried by the inclusion of Singapore's Chinese majority and the political challenge of the PAP in Malaysia.
The 1964 race riots in Singapore followed, such as that on 21 July 1964, near Kallang Gasworks, in which 23 people were killed and hundreds injured as Chinese and Malays attacked each other. It is still disputed how the riots started, and theories include a bottle being thrown into a Muslim rally by a Chinese, while others have argued that it was started by a Malay. More riots broke out in September 1964, as rioters looted cars and shops, forcing both Tunku Abdul Rahman and Lee to make public appearances to calm the situation.
Unable to resolve the crisis, "The Tunku" decided to expel Singapore from Malaysia, choosing to "sever all ties with a State Government that showed no measure of loyalty to its Central Government". Lee was adamant and tried to work out a compromise, but without success. He was later convinced by Goh Keng Swee that the secession was inevitable.[31] Lee signed a separation agreement on 7 August 1965, which discussed Singapore's post-separation relations with Malaysia in order to continue co-operation in areas such as trade and mutual defence.
The failure of the merger was a heavy blow to Lee, who believed that it was crucial for Singapore’s survival. In a televised press conference on television that day, he fought back tears[32] and briefly stopped to regain his composure as he formally announced the separation and the full independence of Singapore to an anxious population:
"Every time we look back on this moment when we signed this agreement which severed Singapore from Malaysia, it will be a moment of anguish. 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 that we, as a people are connected by geography, economics, by ties of kinship..."[33]
On that same day, 9 August 1965, just as the press conference ended, the Malaysian parliament passed the required resolution that would sever Singapore's ties to Malaysia as a state, and thus the Republic of Singapore was created. Singapore's lack of natural resources, a water supply that was derived primarily from Malaysia and a very limited defensive capability were the major challenges which Lee and the nascent Singaporean government faced