to withdraw from his area. In 1016 Basil II again try to attack Pernik. After 88-day siege and numerous losses Byzantine Emperor was forced to withdraw. The legend remains that the blood from the Byzantine warriors was so much, that the rocks at the foot of the fortress of Pernik become red. From there came the name of the place around – Bloody. In 1017 Krakra gathered a great army combined Pechenegs. Both army forces were preparing to strike at Byzantium to liberate the lands between the Danube and the Stara Planina from Byzantine invaders. The politics of Constantinople bribe Pechenegs and they break up the union with Bulgarians. After the death of Tsar Ivan Vladislav in 1018, who left no apparent heirs to the throne, Krakra successfully negotiated with the Byzantines that the Bulgarians keep their internal independence in the newly formed theme Bulgaria. All Bulgarian nobility remained untouched and Bulgarian forces fully armed. The head of the Bulgarian church also remained Bulgarian. Today Pernik Fortress is one of the largest historic landmarks. In the time of the Ottoman occupation Pernik lost its significance as a fortress because it was located deep in the interior. In the town had not settled any other ethnic groups, except Bulgarians and the population lives relatively calm in recent centuries. Until after the Liberation of Bulgaria Pernik was a small stockbreeding village, consisting of several scattered hamlets. The beginning of Pernik's modern history is set in the 20th century with the development of the rich coal-beds of the region. According to some scientists, the existence of coal was already known in the 10th and 11th centuries. Before their industrial exploitation started, the local people dug it up with picks and shovels and transported coal with carts and wheelbarrows. Pernik's rapid development is associated with the large shipments of coal to the capital city, intended for household needs and for the railroad transport. Until then, coal for the railroads and the river and sea steamboats was delivered from as far as Cardiff in the United Kingdom. As the first miners' quarters were built on the terraces of the Struma River, the beginning of the miners' settlement of Pernik was set, one kilometre () to the east of the village of the same name. It is a town since 1929, and since 1958 — a regional centre. The coal output reached its apogee at that