Due to the fertile foothills and the favourable terrain for defence Pirin has been continuously inhabited since prehistoric times. Archaeological remains left by the Thracians have been discovered at the western foothills along the Struma Valley and in the Razlog Valley. As the region was annexed by the Roman Empire by the 1st century BC the number of settlements saw further expansion. During the Early Middle Ages the area around Pirin was settled by Slavic tribes along with most of the Balkans and was absorbed by the Bulgarian Empire in the 9th century. Throughout the Middle Ages Pirin remained contested between the Bulgarian and the Byzantine Empires until it was conquered by the Ottoman Turks in the late 14th century. The population of the region played an active role during the Bulgarian National Revival and the struggle for national liberation. The important 18th century Bulgarian enlightener Paisius of Hilendar and author of "Istoriya Slavyanobolgarskaya" was born in Bansko at the northern foothills of Pirin. Bulgaria achieved liberation in 1878 but as a result of the Congress of Berlin Pirin remained in the Ottoman Empire. In response, the local population in Pirin rebelled in the Kresna–Razlog uprising (1878–1879) and later took part in the Ilinden–Preobrazhenie Uprising (1903) but both were quelled by the Ottomans. The region was finally liberated by the Bulgarian Army in October 1912 during the course of the First Balkan War (1912–1913).