From 1657, it was the seat of the historic Royal University of Kassa (Universitas Cassoviensis), founded by Bishop Benedict Kishdy. The university was transformed into a "Royal Academy" in 1777, then into a "Law Academy" in the 19th century. It ceased to exist in the turbulent year of 1921. After the end of the anti-Habsburg uprisings in 1711, the victorious Austrian armies drove the Ottoman forces back to the south, and this major territorial change created new trade routes which circumvented Košice. The city began to decay and turned from a rich medieval town into a provincial town known for its military base and dependent mainly on agriculture.