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.