The diplomatic foreign relations of the United Kingdom are conducted by the Foreign, Commonwealth and Development Office, headed by the Foreign Secretary. The prime minister and numerous other agencies play a role in setting policy, and many institutions and businesses have a voice and a role. The United Kingdom was the world's foremost power during the 19th and early 20th centuries, most notably during the so-called "Pax Britannica"a period of totally unrivaled supremacy and unprecedented international peace during the mid-to-late 1800s. The country continued to be widely considered a superpower until the Suez crisis of 1956, and this embarrassing incident coupled with the loss of the empire left the UK's dominant role in global affairs to be gradually diminished. Nevertheless, the United Kingdom remains a great power and a permanent member of the United Nations Security Council, a founding member of the G7, G8, G20, NATO, AUKUS, OECD, WTO, Council of Europe, OSCE, and the Commonwealth of Nations, the latter being a legacy of the British Empire. The UK had been a member state of the European Union (and a member of its predecessors) since 1973. However, due to the outcome of a 2016 membership referendum, proceedings to withdraw from the EU began in 2017 and concluded when the UK formally left the EU on 31 January 2020, and the transition period on 31 December 2020 with an EU trade agreement. Since the vote and the conclusion of trade talks with the EU, policymakers have begun pursuing new trade agreements with other global partners. History Following the formation of the Kingdom of Great Britain (which united England and Scotland) in 1707, British foreign relations largely continued those of the Kingdom of England. British foreign policy initially focused on achieving a balance of power within Europe, with no one country achieving dominance over the affairs of the continent. This policy remained a major justification for Britain's wars against Napoleon, and for British involvement in the First and Second World Wars. Secondly Britain continued the expansion of its colonial "First British Empire" by migration and investment. France was the chief enemy until the defeat of Napoleon in 1815. It had a much larger population and a more powerful army, but a weaker navy. The British were generally successful in their many wars. The notable exception, the American War of Independence (1775–1783), saw Britain, without any major allies, defeated by the American colonials