In the 5th century, the area was invaded by the Burgundians, and by the medieval period became part of Upper Burgundy. During the 6th or 7th century, the Germanic speaking Alamanni moved into the area around Lake Biel, creating the language boundary that exists today. By the 8th century, the German-speaking population became the majority on the east end of the lake. In 999 Rudolph III of Burgundy granted lands around Lake Biel to the Bishopric of Basel, during the formative period of the Holy Roman Empire. Through the Bishop of Basel, the Counts of Neuchâtel and later the Counts of Neuchâtel-Nidau began to exercise their power in the foothills of the Jura Mountains. In 1140 the counts built Nidau Castle in the neighboring village of Nidau to help secure their land on the eastern end of the lake. The town was probably built by the Bishop of Basel, Heinrich II von Thun, between 1225 (mention of "domum de Bilne") and 1230 (mention of "in urbe mea de Beuna"). Biel Castle was built either shortly before or shortly after the foundation of the town, to help support Nidau Castle.