Kungshuset, the "King's House", is a building in Lund in Sweden, built by the Danish king Frederick II between 1578”“84 and originally intended as the residence for the bishop of Lund. After the secession of the Scanian lands to Sweden at the Treaty of Roskilde 1658, and the foundation of Lund University in 1666 to enhance the Swedification of the Danish provinces, the house was incorporated to serve as the university's main building and library. For a time the top of the tower also held an observatory. An often related local legend has it that king Charles XII of Sweden, who resided in Lund for a time between campaigns in the 1710s, rode up the wide wooden stairs in the tower. The legend is easily debunked, as the tower was added to the building only later in the 18th century. The house held the University Library in the mid-19th century, but was in a bad shape, with a leaking roof for instance. The professor of Greek language at the time, Carl Georg Brunius, whose prolific work as an amateur architect is seen in many characteristic Lund buildings, took it as upon himself to improve the condition of the building. Today, Kungshuset houses the Department of Philosophy. The nearest buildings are the towering Lund Cathedral located 50 meters south, and the 19th century main building of the university immediately to the north.