Formation of the medieval city
During the 9th century, the Slav settlements gradually fell under the rule of the Francs. The 9th century also saw frequent Hungarian raids. Around the year 1000, the Hungarians were defeated by the Germans and their territories were allocated to various German noble families. Between 1112 and 1125, a smaller estate near the Ljubljana castle hill was allocated to the Patriarchate of Aquilea. The document giving evidence of this represents the first written record mentioning Ljubljana. Later the Ljubljana Basin passed under the rule of the Carinthian family of the Dukes of Spanheim.
Growth of Ljubljana
A rapid growth of Ljubljana, which was at the time called Laibach, started in the 13th century, when the town consisted of three town cores: Old Square (Stari trg), Town Square (Mestni trg) and New Square (Novi trg). The town was entered by five gates and its three quarters were connected by two bridges, namely the Lower Bridge (Spodnji most, also known as Špitalski most), and the Upper Bridge (Zgornji most), which later assumed the name of Butchers' Bridge (Mesarski most) and is currently known as the Cobblers' Bridge (Čevljarski most).
In 1220, Ljubljana was granted city rights, among others the right to coin its own money. Craftsmen, who made up the greater part of the city's population, were organized in craft guilds. In 1270, the city was conquered by the Czech king Premysl Otakar II, and in 1278 it fell under the Hapsburg rule along with the rest of the Province of Carniola (Dežela Kranjska). Under the Hapsburg rulers it was granted as many as 39 trade and other privileges, which attracted numerous merchants and craftsmen from around Europe. In 1461 the Ljubljana Diocese was founded and the Church of St. Nicholas became a cathedral.