The town of Pernik (Regional administrative centre) is the largest town in Southwestern Bulgaria after the capital city of Sofia. It is situated in the high Pernik Plain between Vitosha, Lyulin and Golo Burdo Mountains, along the Strouma River. The town is 30 km to the southwest of Sofia, 59 km to the northeast of Kyustendil and 70 km to the north of Blagoevgrad. It is the largest coal mining centre in Bulgaria. Pernik has rich history. In the 9th century the small Slav settlement of ancient history became part of Danubian Bulgaria. It was named Pernik (Perunik, Perinik) probably at its establishment. The town was turned into a strategic medieval centre and the 4.5 m thick fortress walls kept back the Byzantine invasions towards Sredets (Sofia) and Northwestern Bulgaria. Pernik was declared a town in 1929.