By the spring of 1940, an 82,000 strong army was mobilized in France and elsewhere. Polish soldiers and ships fought in the Norwegian Campaign. France was invaded and defeated by Germany. The Polish Army units, dispersed and attached to various French formations, fought in the defense of France and covered the French retreat, losing 1,400 men. On 18 June 1940, Sikorski went to England and made arrangements for the evacuation of the Polish government and armed forces to the British Isles. Only 19,000 soldiers and airmen could be evacuated, which amounted to less than a quarter of the Polish military personnel established in France. The infighting within the exile government circles continued. On July 18 President Raczkiewicz dismissed Prime Minister Sikorski because of the disagreements concerning possible cooperation with the Soviet Union. Sikorski's supporters in the Polish military and the British government intervened and Sikorski was reinstated, but the internal conflict among the Polish "émigrés" intensified. Polish pilots became famous because of their exceptional contributions during the Battle of Britain. Polish sailors, on Polish and British ships, served with distinction in the Battle of the Atlantic. Polish soldiers participated in the North African Campaign. After Germany attacked the Soviet Union on 22 June 1941, the British government allied itself with the Soviet Union on 12 July and Churchill pressed Sikorski to also reach an agreement with the Soviets. The Sikorski–Mayski treaty was signed on 30 July despite strong resistance from Sikorski's opponents in the exile government (three cabinet ministers resigned, including Foreign Minister August Zaleski and General Sosnkowski) and Polish-Soviet diplomatic relations were restored. The territorial aspects of the Molotov–Ribbentrop Pact had been invalidated. Polish soldiers and others imprisoned in the Soviet Union since 1939 were released and the formation of a Polish army there was agreed, intended to fight on the Eastern Front, help the Red Army to liberate Poland and establish a sovereign Polish state. Other issues, including Poland's borders, were left to be determined in the future. A Polish-Soviet military agreement was signed on 14 August; it attempted to specify the political and operational conditions for the functioning of the Polish army. Sikorski's preference, stated around 1 September, was for the Polish army to be deployed in defense of the Caucasus oil fields, which would allow it to maintain close contacts with the British forces. To resolve the various problems that surfaced during the recruitment and training of the Polish divisions and concerning their planned use, Sikorski went to the Soviet Union, where he negotiated with Stalin.