Before the formation of the Malayan Union in 1946, the territories were not placed under a single unified administration, with the exception of the immediate post-war period when a British military officer became the temporary administrator of Malaya. Instead, British Malaya comprised the Straits Settlements, the Federated Malay States, and the Unfederated Malay States. Under British hegemony, Malaya was one of the most profitable territories of the Empire, being the world's largest producer of tin and later rubber. During the Second World War, Japan ruled a part of Malaya as a single unit from Singapore.