The count of Flanders was the ruler or sub-ruler of the county of Flanders, beginning in the 9th century. Later, the title would be held for a time, by the rulers of the Holy Roman Empire and Spain. During the French Revolution, in 1790, the county of Flanders was annexed to France and ceased to exist. In the 19th century, the title was appropriated by Belgium and granted twice to younger sons of Belgian kings. The most recent holder died in 1983. In 862 Baldwin I was appointed as the first Margrave of Flanders by King Charles II. It was a military appointment, responsible for repelling the Viking raids from the coast of Francia. The title of margrave (or marquis) evolved into that of count. Arnulf I was the first to name himself as count, by the Grace of God. The title of margrave largely fell out of use by the 12th century. Since then, the rulers of Flanders have only been referred to as counts. The counts of Flanders enlarged their estate through a series of diplomatic marriages. The counties of Hainaut, Namur, Béthune, Nevers, Auxerre, Rethel, Burgundy, and Artois were all acquired in this manner. However, the County of Flanders suffered the same fate in turn. As a result of the marriage of Countess Margaret III with Philip II, Duke of Burgundy, the county and the subsidiary counties entered a personal union with the Duchy of Burgundy in 1405. The counts of Flanders were also associated with the Duchy of Brittany prior to its union with France. In c.1323, Joan, the daughter of Arthur II, Duke of Brittany, married the second son of Count Robert III. Joanna of Flanders, the granddaughter of Count Robert III and daughter of his son, Count Louis I, married John Montfort. During Montfort's imprisonment, she fought on his behalf, alongside English allies, during the Breton War of Succession for the ducal crown, which was won definitively by her son John V, Duke of Brittany. It was through this alliance that the Duchy of Brittany was eventually joined to the throne of France. List of counts House of Flanders House of Estridsen House of Normandy House of Alsace or House of Metz House of Flanders In 1244, the Counties of Flanders and Hainaut were claimed by Margaret II's sons, the half-brothers John I of Avesnes and William III of Dampierre in the War of