The area around Prešov was sporadically settled from the Palaeolithic onwards, with permanent Slavic settlement known from the 8th and 9th centuries. The earliest written documents date to the years 1233 and 1247. Prešov obtained its charter as a town in 1299, and in 1374 became a royal free borough and a centre for trade and craftsmanship. The town suffered considerably from the Estates` Revolts of the 17th and early 18th centuries. Economic improvement came in the late 18th and early 19th centuries, when Prešov became the seat of the Šariš zupa (administrative district). In the revolutionary years 1848-1849 the town was occupied in turn by Imperial and Hungarian forces. In 1849 it was captured by Slovak volunteers. After the First World War, on June 16th 1919, a Slovak Republic was declared here by the council.