The Wittelsbach Dynasty
The earliest known inhabitants in the area of present-day Bavaria were the Celts. Romans conquered the region about the beginning of the Common Era. They divided the southern part into Raetia and Noricum and built fortifications along the northern boundary to keep out the Teutons. Flourishing Roman colonies arose in the south at Augsburg, Kempten, Regensburg, and Passau.
The Romans were overcome in the 5th century by repeated Germanic attacks. The lands were eventually settled by Germanic tribes from the east and north who mixed with the remaining Celts and Romans. The tribe that gave the territory its name was the Baiovarii (Bavarians), which settled in the south between 488 and 520 ce. In the 7th and 8th centuries Bavaria was Christianized by Irish and Scottish monks. In 788 Charlemagne incorporated Bavaria into the Carolingian empire for a short time.
Bavaria became a part of the Holy Roman Empire in the 10th century. During that period Bavaria was constantly ravaged and all but depopulated by the Hungarians. At the Battle of Pressburg (now Bratislava, Slovakia), on July 4, 907, the Hungarians inflicted a disastrous defeat on the Bavarians, but Hungarian ambitions in Bavaria were checked permanently in 955 by Otto I at the Battle of Lechfeld, just south of Augsburg. That defeat ushered in an era of cooperation between Bavaria and Hungary, culminating in 996 with the marriage of the Bavarian princess Gisela and the Hungarian prince who would be crowned king as Stephen I. In 1180 the Holy Roman Emperor Frederick I Barbarossa gave Bavaria to the count palatine Otto of Wittelsbach. That marked the start of the Wittelsbach dynasty, which was to rule Bavaria until 1918.