The County of Hainaut (French: Comté de Hainaut, Dutch: Graafschap Henegouwen; German: Grafschaft Hennegau; Latin: comitatus hanoniensis), sometimes given the spelling Hainault, was a historical lordship within the medieval Holy Roman Empire with its capital eventually established at Mons (Dutch: Bergen), now in Belgium. It was named after the river Haine, which enters the Scheldt in the west and originates between Binche and modern Charleroi. Besides Mons, it included the city of Valenciennes, now in France. It consisted of most of what is now the Belgian province of Hainaut, and the eastern part of the French département of Nord. Originally a Frankish gau or pagus, Hainaut was an area which was allocated to different kingdoms during the 9th and 10th centuries, being part of both West Francia, the future France, Lotharingia, before Lotharingia was definitively attached to the eastern Frankish realm that would become Germany. A single county of Hainaut was named in 9th century records. As with many counties of the region, there was apparently a 10th century fragmentation of the area among different counts, which is difficult to reconstruct. A single county re-emerged in its more or less final form in 1071. Hainaut was an important frontier area during the Middle Ages. Though it was part of the Holy Roman Empire ruled from what is now Germany, it was culturally and linguistically French, and part of the Catholic Archdiocese of Reims. Like it's neighbours such as the counties of Brabant and Flanders, it was frequently entangled in both French and German politics. In 1432, Hainaut was acquired by the House of Valois-Burgundy, a branch of the French royal family. In 1477 it passed, with the rest of the Burgundian Netherlands, to the Habsburg dynasty, who were emperors of the Holy Roman Empire and kings of Spain. It became part of the Burgundian Circle in 1512. It was ruled by the Spanish branch of the Habsburgs from 1555 to 1714. In 1659 and 1678 southern Hainaut was acquired by France. In 1797, during the French revolution, the northern part of the county was ceded to France by the Emperor Francis II, who was also count of Hainaut. It became the French département of Jemappe. The county was redivided after the defeat of Napoleon at the Battle of Waterloo in 1815, with the northern part, once again called Hainaut, going to the new Kingdom of the Netherlands, and then in 1830 to Kingdom of Belgium which was created from the southern part of that kingdom.