Boulogne was already a pagus within the kingdom of the Franks. There are few records prior to the 11th century. A proverbially wicked count named Herrequin is recorded for the 9th century, but he may be legendary. It seems to have come under the rule of the counts of Flanders in the late 9th or early 10th century. In 886, bishop Gauzlin of Paris asked count Erkenger of Boulogne to solicit German help against the Viking raids. Erkenger was lost all his possessions in 896, as he remained loyal to Charles the Simple. It may have been at this point that Baldwin II, Count of Flanders gained control over Boulogne. Eustace II of Boulogne accompanied William the Conqueror's invasion in 1066. Boulogne was also a major participant in the First Crusade; Eustace III of Boulogne's brothers, Godfrey of Bouillon and Baldwin of Bouillon, both became kings of Jerusalem, and Eustace himself was offered but declined the title. Count Renaud of Boulogne joined the imperial side at the Battle of Bouvines in 1214, and was defeated by Philip II of France. Boulogne passed under nominal royal control in 1223 when it was given to Philip II's son Philip Hurepel. Hurepel revolted against Blanche of Castile when Louis VIII of France died in 1226. When Philip Hurepel died in 1235, Matilda continued to reign and in 1238 was married to Alphonse, second son of King Alfonso II of Portugal, and younger brother of King Sancho II of Portugal. Having become Afonso III of Portugal in 1248 and renounced his title of Count of Boulogne, Alfonse divorced her in 1253 due to her barrenness in favour of Beatrice of Castile. Nevertheless, Matilda and Philip did have a son Alberic, and a daughter Joan who both survived. Alberic reportedly renounced his rights and went to England, for unknown reasons. Apparently he survived his mother and died in 1284, but presumably did not leave issue. Joan was married in 1236 to Gaucher de Châtillon, Count of Mortain. She predeceased her mother in 1252, and presumably left no surviving issue. Consequently, after Matilda, her county of Boulogne then passed to Matilda's niece, Adelaide of Brabant and her husband William X of Auvergne. Bertrand V de la Tour succeeded to the counties of Auvergne and of Boulogne in 1437. Through his son Bertrand VI de la Tour the County of Boulogne passed to his grandson, the last medieval count of Boulogne: Jean III de la Tour d'Auvergne. By his marriage to Jeanne of Bourbon-Vendôme, he left two daughters:
The eldest daughter, Anne of la Tour d'Auvergne, married John Stewart, Duke of Albany, however she died childless in 1524.
On the death of Jean III de la Tour d'Auvergne in 1501, Anne inherited the title Countess of Boulogne however at her death the title passed to Madeleine's daughter Catherine de Medici since Madeleine herself had died in 1519. Catherine became Queen of France in 1549 and the title passed to the French crown. Boulogne was attacked numerous times during the Hundred Years' War and occupied numerous time by the English: the last time from 1544 to 1550. In 1550 the Peace of Boulogne ended the war between England and France and France bought back Boulogne for 400,000 crowns..