|In the early 12th century, Saint-Omer was an important port in western Flanders. However receding sea gradually cut it off from the English Channel, resulting in the construction of a canal to the new coast at what is now Gravelines. The name is derived from the Flemish grave linghe, meaning Count's Canal. The new town became heavily fortified as it guarded the western borders of Spanish territory in Flanders.|
There were two battles fought nearby, the first was a land battle in 1558 resulting in a victory by Spanish forces of Lamoral, Count of Egmont over the French under Marshal Paul des Thermes. The second was a naval attack using fire ships in 1588 launched by the Royal Navy under Lord Howard against the Spanish Armada at anchor.
The town was captured and recaptured several times by the French and Spanish between 1639 and 1658, and finally annexed to France in the Treaty of the Pyrenees of 1659.