A fishing village in the originally flooded coastal area of the English Channel south of the Western Scheldt arose late in the tenth century, when the area was held by the Counts of Flanders, vassals of the French Crown. About 960AD Count Baldwin III had a town wall erected, in order to protect the settlement against Viking raids. The surrounding wetlands were drained and cultivated by the monks of nearby Bergues Abbey. The name Dunkirk (Dutch for 'Church in the dunes') was first mentioned in a tithe privilege of 27 May 1067, issued by Count Baldwin V of Flanders. Count Philip I (1157–1191) brought further large tracts of marshland under cultivation, laid out first plans to build a Canal from Dunkirk to Bergues and vested the Dunkirkers with market rights.
When in the late 13th century the Dampierre count Guy of Flanders entered into the Franco-Flemish War with his suzerain King Philip IV of France, the Dunkirk citizens sided with the French against their count, who first was defeated at the 1297 Battle of Furnes, but reached de facto autonomy upon the victorious Battle of the Golden Spurs five years later and exacted vengeance. Guy's son Count Robert III (1305–1322) nevertheless granted further city rights to Dunkirk, his successor Count Louis I (1322–1346) had to face the Peasant revolt of 1323–1328, which was crushed by King Philip VI of France at the 1328 Battle of Cassel, whereafter the Dunkirkers again were affected by the repressive measures of their lord-paramount.
Count Louis remained a loyal liensmen of the French king upon the outbreak of the Hundred Years' War with England in 1337, and prohibited the maritime trade, which led to another revolt by the Dunkirk citizens. After the count had been killed in the 1346 Battle of Crécy, his son and successor Count Louis II of Flanders (1346 – 1384) signed a truce with the English; the trade again flourished and the port was significantly enlarged. However, in the course of the Western Schism from 1378, English supporters of Pope Urban VI debarked at Dunkirk, captured the city and flooded the surrounding estates. They were ejected by King Charles VI of France, but left great devastations in and around the town.
Upon the extinction of the Counts of Flanders with the death of Louis II in 1384, Flanders was acquired by the Burgundian, Duke Philip the Bold. The fortifications were again enlarged, including the construction of a belfry daymark. As a strategic point, Dunkirk has always been exposed to political covetousness, by Duke Robert I of Bar in 1395, by Louis de Luxembourg in 1435 and finally by the Austrian archduke Maximilian I of Habsburg, who in 1477 married Mary of Burgundy, sole heiress of late Duke Charles the Bold. As Maximilian was the son of Emperor Frederick III, all Flanders was immediately seized by King Louis XI of France. However, the archduke defeated the French troops at the 1479 Battle of Guinegate, and when Mary died in 1482 Maximilian retained Flanders according to the 1482 Treaty of Arras. Dunkirk with Flanders was incorporated into the Habsburg Netherlands and upon the 1581 secession of the Seven United Netherlands, remained part of the Southern Netherlands, which were held by Habsburg Spain (Spanish Netherlands) as Imperial fiefs.
The area remained much disputed between Spain, the United Netherlands, England and France. At the beginning of the Eighty Years' War, Dunkirk was briefly in the hands of the Dutch rebels, from 1577. Spanish forces under the Duke of Parma re-established Spanish rule in 1583 and it became a base for the notorious Dunkirkers. The Dunkirkers briefly lost their home port when the city was conquered by the French in 1646 but Spanish forces recaptured the city in 1652. In 1658, as a result of the long war between France and Spain, it was captured after a siege by Franco-English forces following the battle of the Dunes. It was awarded to England in the peace the following year as agreed in the Franco-English alliance against Spain.
It came under French rule when Charles II of England sold it to France for £320,000 on 17 October 1662. The French government developed the town as a fortified port. The town's existing defences were adapted to create ten bastions. The port was expanded in the 1670s by the construction of a basin that could hold up to thirty warships with a double lock system to maintain water levels at low tide. The basin was linked to the sea by a channel dug through coastal sandbanks secured by two jetties. This work was completed by 1678. The jetties were defended a few years later by the construction of five forts, Château d'Espérance, Château Vert, Grand Risban, Château Gaillard, and Fort de Revers. An additional fort was built in 1701 called Fort Blanc. The jetties, their forts, and the port facilities were demolished in 1713 under the terms of the Treaty of Utrecht.
During the reign of Louis XIV, a large number of commerce raiders once again made their base at Dunkirk. Jean Bart was the most famous. The Man in the Iron Mask was arrested at Dunkirk. The 18th century Swedish privateers and pirates Lars Gathenhielm and his wife and partner Ingela Hammar, are known to have sold their ill-gotten gains in Dunkirk. The Treaty of Paris (1763) between France and Great Britain included a clause restricting French rights to fortify Dunkirk, to allay British fears of it being used as an invasion base.
Dunkirk in World War I
Dunkirk in World War II
In May 1940, during the Battle of France, the British Expeditionary Force in France aiding the French, was cut off from the rest of the French Army by the German advance. Encircled by the Germans they retreated to the area around the port of Dunkirk. The German land forces could have easily destroyed the British Expeditionary Force, especially when many of the British troops, in their haste to withdraw, had left behind their heavy equipment. For years, it was assumed that Adolf Hitler ordered the German Army to stop the attack, favouring bombardment by the Luftwaffe. However, according to the Official War Diary of Army Group A, its commander, Generaloberst Gerd von Rundstedt, ordered the halt. Hitler merely validated the order several hours after the fact. This lull in the action gave the British a few days to evacuate by sea. Winston Churchill ordered any ship or boat available, large or small, to pick up the stranded soldiers, and 338,226 men (including 123,000 French soldiers) were evacuated – the miracle of Dunkirk, as Churchill called it. It took over 900 vessels to evacuate the Allied forces and although over two-thirds of those rescued embarked via the harbour, almost 100,000 were taken off the beaches. More than 40,000 vehicles as well as massive amounts of other military equipment and supplies were left behind; their value being less than that of trained fighting men. The British evacuation of Dunkirk through the English Channel was codenamed Operation Dynamo. Forty thousand Allied soldiers (some who carried on fighting after the official evacuation) were captured or forced to make their own way home through a variety of routes including via neutral Spain.
During the German occupation, Dunkirk was largely destroyed by Allied bombings; the artillery siege of Dunkirk was directed on the final day of the war by pilots from No. 652 Squadron RAF, and No. 665 Squadron RCAF.