The main line of the Přemyslid dynasty became extinct in 1306, and in 1310 John of Luxembourg became Margrave of Moravia and King of Bohemia. In 1333, he made his son Charles the next Margrave of Moravia (later in 1346, Charles also became the King of Bohemia). In 1349, Charles gave Moravia to his younger brother John Henry who ruled in the margraviate until his death in 1375, after him Moravia was ruled by his oldest son Jobst of Moravia who was in 1410 elected the Holy Roman King but died in 1411 (he is buried with his father in the Church of St. Thomas in Brno – the Moravian capital from which they both ruled). Moravia and Bohemia remained within the Luxembourg dynasty of Holy Roman kings and emperors (except during the Hussite wars), until inherited by Albert II of Habsburg in 1437.