The number of Poles in Britain increased during the Second World War. Most of the Polish people who came to the United Kingdom at that time came as part of military units reconstituted outside Poland after the German-Soviet invasion of Poland in September 1939, which marked the beginning of World War II. On 3 September 1939, Britain and France, which were allied with Poland, declared war on Germany. Poland moved its government abroad, first to France and, after its fall in May 1940, to London. The Poles contributed greatly to the Allied war effort; Polish naval units were the first Polish forces to integrate with the Royal Navy under the "Peking Plan". Polish pilots played a conspicuous role in the Battle of Britain and the Polish army formed in Britain later participated in the Allied invasion of Nazi-occupied France. The great majority of Polish military veterans were stranded in Britain after the Soviet Union imposed communist control on Poland after the war. This particularly concerned Polish soldiers from eastern areas, which were no longer part of Poland as a result of border changes due to the Potsdam Agreement. The Polish government-in-exile, though denied majority international recognition after 1945, remained at its post in London until it formally dissolved in 1991, after a democratically elected president had taken office in Warsaw.