The Federation of Malaya, or in MalayPersekutuan Tanah Melayu, was formed in 1948 from the British settlements of Penang and Malacca and the nine Malay states and replaced the Malayan Union. Within the Federation, while the Malay states were protectorates of the United Kingdom, Penang and Malacca remained British colonial territories.