The Federation of Malaya (Malay: Persekutuan Tanah Melayu; Jawi: ڤرسكوتوان تانه ملايو) is the name given to a federation of 11 states (nine Malay states and two of the British Straits Settlements, Penang and Malacca) that existed from 31 January 1948 until 16 September 1963. The Federation became independent on 31 August 1957. It was reconstituted as Malaysia with the addition in 1963 of Singapore, Sabah, and Sarawak.
From 1946 to 1948, the 11 states formed a single British crown colony known as the Malayan Union. Due to opposition from Malay nationalists, the Union was disbanded and replaced by the Federation of Malaya, which restored the symbolic positions of the rulers of the Malay states.
Within the Federation, while the Malay states were protectorates of the United Kingdom, Penang and Malacca remained British colonial territories. Like the Malayan Union before it, the Federation did not include Singapore, despite its traditional connections with Malaya.
The Federation achieved independence within the Commonwealth of Nations on 31 August 1957. In 1963, the Federation was reconstitued as "Malaysia" when it federated with the British territories of Singapore, Sarawak, and British North Borneo (renamed Sabah); the latter territory was claimed to be a part of the Sultanate of Sulu. Singapore separated from Malaysia to become an independent republic on 9 August 1965.