of being ruled by Christian dukes from the 6th century, but Christianization of its population was a gradual process lasting throughout the 7th century and into the 8th; Saint Corbinian was sent by Pope Gregory II to minister to duke Grimoald and work towards the evangelization of Bavaria; he became the first bishop of Freising. A Diocese of Laureacum (Lorch) had been in existence since the 4th century, in the 8th century moved to Passau, which became a bridge-head for the Christianization of Austria and Hungary. The Bishopric of Regensburg was founded in 739 by Boniface. The Lex Baiuvariorum was a codex of Germanic law, comprising 23 articles of traditional law recorded in the 740s. Bavaria within the Carolingian Empire was bordering on Swabia in the west, Thuringia in the north, Lombardy in the south and Slavic Carinthia in the east. Holy Roman Empire The Duchy of Bavaria was a stem duchy of the Holy Roman Empire, established in the 10th century, derived from an earlier duchy ruled by the Frankish Agilolfings during the 6th to 8th centuries. The Margraviate of Austria was formed an eastern march to the Duchy of Bavaria in 976, and became a duchy in its own right, the Duchy of Austria, in 1156, in the 13th century falling under the dominion of the House of Habsburg. In the 14th and 15th centuries, upper and lower Bavaria were repeatedly subdivided. Four Duchies (or "partial duchies", Teilherzogtümer) existed after the division of 1392: Lower Bavaria-Straubing, lower Bavaria-Landshut, Bavaria-Ingolstadt and Bavaria-Munich. Munich, now the capital and cultural center of Bavaria, was founded in the high medieval period, and was the capital of the "partial duchy" of Bavaria-Munich 1392–1503. In 1503, Bavaria was re-united by Duke Albrecht IV of Bavaria-Munich (although the formerly Bavarian offices Kufstein, Kitzbühel and Rattenberg in Tirol were lost in 1504) and established Munich as the capital of all of Bavaria in 1506. In 1623, Bavaria was elevated to Electorate (Kurfürstentum). Modern history The Kingdom of Bavaria was established at the Peace of Pressburg (1805), in the wake of the French victory at Austerlitz. The kingdom's territory fluctuated greatly over the following years, eventually fixed at the Treaty of Paris (1814), which established most of what remain the borders of the modern state. The kingdom in 1837 was divided into eight administrative regions (Regierungsbezirke), Upper Bavaria, Lower Bavaria, Franconia, Swabia, Upper Palatinate and Palatinate. Ludwig