Kranj (known in historic sources at various times as Carnium, Creina, Chreina or Krainburg) is the fourth largest city in Slovenia, with a population of 54,500 (2010). It is located approximately 20 km north-west of Ljubljana. The centre of the City Municipality of Kranj and of the traditional region of Upper Carniola (northwestern Slovenia) is a mainly industrial city with significant electronics and rubber industries. The historical region of Carniola (Kranjska) is named after the town, which was its provincial capital in the early Middle Ages. The nucleus of the city is a well-preserved medieval old town, built at the confluence of the Kokra and the Sava rivers.