17th and 18th centuries, the castle became an arsenal. In 1797 the town of Ljubljana and the castle were occupied for the first time by the French army, and again in 1809. In the period of the Illyrian Provinces, the castle was used as barracks and a military hospital. In 1815, back in the Austrian Empire, it became a prison, which it remained until 1895, with a hiatus between 1848 and 1868, resuming that function during World War II. The castle's Viewing Tower dates to 1848; this was inhabited by a guard whose duty it was to fire cannons warning the city in case of fire or announcing important visitors or events. Because it was not a home of a ruler or another important noble person and because a fortification in the area was no longer required, the castle started to lose its importance. The maintenance costs were too high so the castle began to crumble. In the 19th century, the castle was redesigned partially as a prison and partially as a military stronghold, making it less popular among the citizens. Several famous people were jailed in the castle, including the Italian revolutionary Silvio Pellico, the Hungarian Prime Minister Lajos Batthyany and the Slovene author Ivan Cankar. In 1905, the castle was bought by Municipality of Ljubljana for 60,200 Kronen, on the explicit wish of the mayor, Ivan Hribar, who planned to establish a city museum in it. The plan was however not carried out. Instead, the city decided to settle poor families into it. The residents stayed there until 1963, when preparations for renovation of the castle began. The remains of the fortifications on Castle Hill were reworked in the 1930s a promenade called Šance, designed by the Slovenian architect Jože Plečnik. Contemporary history Extensive renovation works commenced in the late 1960s; lasting more than 35 years. In the 1990s, the castle began to be used as a place for weddings and cultural events. In 1974, a monument by the sculptor Stojan Batič dedicated to the Slovene peasant revolts (especially to the Slovene peasant revolt of 1515 and the Croatian and Slovenian peasant revolt of 1573) was erected in the vicinity of the castle. The Ljubljana Castle funicular, a funicular railway to the top of Castle Hill, was built in 2006 and began service on 28 December 2006. Architecture Today the castle consists of the following buildings. To the