The Dunkirk evacuation, codenamed Operation Dynamo and also known as the Miracle of Dunkirk, or just Dunkirk, was the evacuation of more than 338,000 Allied soldiers during the Second World War from the beaches and harbour of Dunkirk, in the north of France, between 26 May and 4 June 1940. The operation commenced after large numbers of Belgian, British, and French troops were cut off and surrounded by German troops during the six-week Battle of France. In a speech to the House of Commons, British Prime Minister Winston Churchill called this "a colossal military disaster", saying "the whole root and core and brain of the British Army" had been stranded at Dunkirk and seemed about to perish or be captured. In his "We shall fight on the beaches" speech on 4 June, he hailed their rescue as a "miracle of deliverance".
After Germany invaded Poland in September 1939, France and the British Empire declared war on Germany and imposed an economic blockade. The British Expeditionary Force (BEF) was sent to help defend France. After the Phoney War of October 1939 to April 1940, Germany invaded Belgium, the Netherlands, and France on 10 May 1940. Three panzer corps attacked through the Ardennes and drove northwest to the English Channel. By 21 May, German forces had trapped the BEF, the remains of the Belgian forces, and three French field armies along the northern coast of France. BEF commander General Viscount Gort immediately saw evacuation across the Channel as the best course of action, and began planning a withdrawal to Dunkirk, the closest good port.
Late on 23 May, a halt order was issued by Generaloberst Gerd von Rundstedt, commander of Army Group A. Adolf Hitler approved this order the next day, and had the German High Command send confirmation to the front. Attacking the trapped BEF, French, and Belgian armies was left to the Luftwaffe until the order was rescinded on 26 May. This gave Allied forces time to construct defensive works and pull back large numbers of troops to fight the Battle of Dunkirk.