In the early Middle Ages, the city was ruled by the Austrian Babenberg dynasty, and after the dynasty expired, the reign was taken over by the Ottokar II of Bohemia, during whose reign the city’s economy flourished.