The first to use the title of "King of Bohemia" was Boleslav I after 940, but his heirs again used the title of Duke. The title of King was granted to the Premyslid dukes Vratislav II (1085) and Vladislav II (1158), and became hereditary (1198) under Ottokar I, whose grandson Ottokar II (king 1253-1278) founded a short-lived empire also covering modern Austria. The mid-13th century saw the beginning of substantial German immigration as the court sought to make good the losses resulting from the brief Mongol invasion of 1241. In 1346, Charles IV became King of Bohemia. In 1348 he founded central Europe's first university in Prague. His reign brought Bohemia to its peak both politically and in total area, resulting in his being the first King of Bohemia to be elected as Holy Roman Emperor.
