It was the principal seaport in north-western France for six centuries, until Le Havre was built about five kilometres (three miles) downstream in the sixteenth century to take advantage of anchorages less prone to siltation. Harfleur is now on the eastern edge of Le Havre's urban area.

In Roman times, Harfleur was known as Caracotinum, the principal port of the ancient Calates. A Roman road led from Harfleur to Troyes. Another road that disappeared during the Hundred Years War linked Harfleur to Fécamp.

Several Merovingian sarcophagi have been unearthed at the foot of Mount Cabert.

In the Middle Ages, the town's name, Herosfloth, Harofluet or Hareflot, was still sufficiently uncorrupted to indicate its Norman origins. The suffix fleur comes from Old NorseFlöthe meaning "estuary or arm of the sea" and is related to the word fjord. The precise meaning of the prefix "har" is unknown.

At the beginning of the 14th century, Harfleur saw the setting-up of a Catalan and Portuguese merchants association.

1341–1361 saw the building of the city walls, pierced by three gates (Porte d’Eure, Porte de Rouen and Montivilliers Gate). These were restored in the 15th century after the destruction caused during the Hundred Years War.

The church and some timber framing houses

For six centuries, Harfleur was the principal seaport of north-western France. In 1415, it was captured by Henry V of England, an event explicitly mentioned in a popular song of the day, the Agincourt Carol. Sir John Fastolf of Caister CastleNorfolk (1380–1459) later claimed to have been 'the first man over the side' of the boat when the English landed outside the town; and he certainly played a part in the siege, being invalided home afterwards. The Siege of Harfleur lasted some weeks longer than Henry V had anticipated - and wasn't helped by the outbreak of dysentery which afflicted and killed soldiers, knights, and nobles, with many of the sick having to be transported back to England. The town's defences were badly damaged by the siege warfare, as were many of the principal buildings of the town. In order to consolidate his victory, Henry was forced to leave a significant part of his army as a garrison for the newly captured town. Whilst Henry's intentions after the end of the siege are unclear, he had clearly entered France with an army large enough to engage the French in open battle and not merely to lay siege to one town. Henry left Harfleur, but he found his path to Calais blocked by a French army forcing him inland. The French cut off the English route and confronted them on the muddy fields near Azincourt (not the present-day Agincourt) on Saint Crispin's day, October 25, 1415. The Battle of Agincourt ended in a decisive English victory with minimal losses - only in the hundreds - and a crushing defeat for the French with losses nearing the tens of thousands.

In 1435, the people of the district of Caux, led by Jean de Grouchy, rose against the English. One hundred and four of the inhabitants opened the gates of the town to the insurgents, and forced the English occupiers out. The memory of the deed was long perpetuated by the bells of St. Martin's tolling 104 strokes.

Between 1445 and 1449 the English were again in possession, but the town was recovered for the French by Dunois in 1450. In 1562, the Huguenots pillaged Harfleur and its registers and charters perished in the confusion, but its privileges were restored by Charles IX of France in 1568. It was not until 1710 that it was subjected to the "taille".

In the 16th century, the port began to dwindle in importance owing to the silting up of the Seine estuary and the rise of Le Havre. In 1887, the Tancarville canal restored waterborne access to the town from both the Seine and Le Havre.

The 2003 novel A Hail of Arrows by Michael Cox describes the siege and conquest of Harfleur by the army of Henry V of England in 1415 as witnessed by a 14-year-old boy-archer. Its describes illness and food shortage inflicted by the English army. It goes on to describe the battle of Agincourt.