According to archaeological researches, human has used the surroundings of the current castle complex since 1200 BC, when the first settlements and then fortifications appeared here. The first written mentions of Ljubljana Castle date back to the period between 1112 and 1125, when Rudolf of Tarcente donated a small plot of land near Ljubljana Castle to the Patriarchate. In 1144 the castle was mentioned as the residence of the Carinthian Dukes of Spanheim.
The castle changed its original appearance in XV century, when it was expanded (walls with corner towers and two entrance towers through which the lifting gates led and the castle chapel was built). In the XVI-XVII centuries, the remaining buildings adjacent to the castle courtyard were gradually completed and formed the current castle building complex. Due to the decrease in administrative significance (rulers or regional administrators, authorized representatives of the central government never lived in the castle), as well as the loss of the strategic significance of the castle with its walls, the maintenance of the castle became financially costly, so it gradually began to collapse.
At the beginning of the XIX century, the authorities established a prison and partly a military fort with barracks in the castle. In the middle of the XIX century, Ljubljana Castle received its highest point: an observation tower. The initial task of the tower is to monitor the surrounding area to speed up the response to emerging fires.
The municipality of Ljubljana, on the instructions of mayor Ivan Hribar, bought the castle in 1905 and settled there with local residents: those who had lost their homes and/or jobs. The castle was divided into many small apartments and was constantly rebuilt by its new inhabitants. The castle remained inhabited until the mid-sixties of the XX century, when preparations for restoration began. At the end of the 1960s, a more than 35-year period of restoration of the castle began. In 1982, the observation tower in the castle was repaired and raised by 1.2 meters, so that its clearance on the upper platform is exactly 400 m above sea level; In 2009, the observation tower was renovated again. The viewing platform on the observation tower is now one of the most visited places by tourists in Slovenia.
In the 90s of the XX century, the castle began to host many wedding ceremonies, which the city authorities began to organize in the first restored castle building (next to the tower and then the chapel), and after 2000 - in Ljubljana Castle. It has become the venue for many cultural events and exhibitions.
Since 2006, you can reach the castle by cable car with a height difference of about 70 meters. The idea of the funicular belonged to the mayor of Ljubljana, Ivan Hribar, at the end of the XIX century. An excellent way to explore is to take the funicular up and down one of the paths connecting the castle with the old part of Ljubljana.
Now the castle houses a museum, several art exhibitions, a wine library and restaurants.