Pernik is a city in western Bulgaria, situated about 20 kilometers southwest of the capital city, Sofia.