In early 1938, Anderson was elected to the House of Commons by the Scottish Universities as a National IndependentMember of Parliament, a non-party supporter of the National Government. In October that year he entered Neville Chamberlain's Cabinet as Lord Privy Seal. In that capacity, he was put in charge of air raid preparations. He initiated the development of a kind of air-raid shelter named the "Anderson shelter", a small sheet metal cylinder made of prefabricated pieces which could be assembled in a garden and partially buried to protect against bomb blast.
War time
After the outbreak of the Second World War in September 1939, Anderson returned to hold the joint portfolio of Home Secretary and Minister of Home Security, a position in which he served under Winston Churchill, often attending his War Cabinet. He retained responsibility for civil defence. In October 1940, he was replaced by Herbert Morrison in a reshuffle precipitated by Chamberlain's resignation over ill-health. He became Lord President of the Council and full member of the War Cabinet. In July 1941 as Lord President of the Council he was appointed as minister responsible for the British plan to build an atomic bomb, known as the Tube Alloys project. In January 1945, the Prime Minister wrote to King George VI to advise that should he and his second-in-command Anthony Eden die during the war, John Anderson should become Prime Minister: "it is the Prime Minister's duty to advise Your Majesty to send for Sir John Anderson in the event of the Prime Minister and the Foreign Secretary being killed." Although not a member of a political party, Churchill thought Anderson had the abilities to lead the National Government, and that an independent figure was essential to the maintenance of the coalition. Following the unexpected death on 21 September 1943 of Sir Kingsley Wood, the Chancellor of the Exchequer, Anderson was appointed to that office. As Chancellor, in a written Commons answer of 12 June 1945, he announced the creation of the Arts Council of Great Britain, a successor body to the Council for the Encouragement of Music and the Arts. He remained in the post until the Labour victory in the general election in July 1945.
Post-war
He left the Commons when the University constituencies were abolished at the 1950 general election. Meanwhile, he became Chairman of the Port of London Authority in 1946 and Chairman of the Royal Opera House in March the same year. He remained in the latter post for eleven years. He rejected an offer to join Churchill's peacetime administration when it was formed in October 1951, and was created Viscount Waverley, of Westdean in the County of Sussex, in 1952. He died six years later at the age of 75 in St Thomas' Hospital, Lambeth, London.
Personal life
Anderson's first marriage was in 1907 to Christina Mackenzie. The couple had two children:
Christina died in 1920. In 1941, he married Ava Wigram, daughter of John Edward Courtenay Bodley. She was the widow of Ralph Wigram, a senior civil servant who had provided Winston Churchill with confidential military information during the 1930s.