Britain's Statute of Westminster 1931 formally ended most of the constitutional links between Australia and the United Kingdom. Australia adopted it in 1942, but it was backdated to 1939 to confirm the validity of legislation passed by the Australian Parliament during World War II. The shock of Britain's defeat in Asia in 1942, followed soon after by the bombing of Darwin and other Japanese attacks, led to a widespread belief in Australia that an invasion was imminent, and a shift towards the United States as a new ally and protector. Since 1951, Australia has been a formal military ally of the United States, under the ANZUS treaty.