Dunkirk (UKdʌnˈkɜːrk , USˈdʌnkɜːrk ; Dunkerque dœ̃kɛʁk) is a commune in the department of Nord in northern France. It lies from the Belgian border. It has the third-largest French harbour. The population of the commune in 2019 was 86,279. The name of Dunkirk derives from West Flemish dun(e) 'dune' or 'dun' and kerke 'church', thus 'church in the dunes'. A smaller town 25 km farther up the Flemish coast originally shared the same name, but was later renamed Oostduinkerke(n) in order to avoid confusion. Until the middle of the 20th century, French Flemish (the local variety of Dutch) was commonly spoken. A fishing village arose late in the tenth century, in the originally flooded coastal area of the English Channel south of the Western Scheldt, when the area was held by the Counts of Flanders, vassals of the French Crown. About AD 960, 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 Dunkirka 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 the first plans to build a Canal from Dunkirk to Bergues and vested the Dunkirkers with market rights. In the late 13th century, when the Dampierre count Guy of Flanders entered into the Franco-Flemish War against his suzerain King Philippe IV of France, the citizens of Dunkirk sided with the French against their count, who at 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 Philippe VI of France at the 1328 Battle of Cassel, whereafter the Dunkirkers again were affected by the repressive measures of the French king.