In 1803 the Prince-Bishopric of Freising was mediatised during the "German Mediatisation" and the enclave of Škofja Loka was annexed to the Austrian duchy of Carniola. Škofja Loka was the first town in Carniola to receive electric lights, even before the 1895 Ljubljana earthquake.