To the question when exactly the settlement appeared still cannot be given a definite answer. The origin dates back somewhere between XII and XIVc. In 1371 it fell under the Ottoman Empire. Between XIV and XIXc travelers and chroniclers give partial but very interesting records about the town as important production center for the needs of the ottoman army, marching against Christian Europe. But the town was also a fortress of the Bulgarian spirit and Christianity. It had a leading place in the struggle for ethnic and religious independence during the Revival. One of the leaders of this struggle - bishop Avksentii Veleshki - was from Samokov and Paisii of Hilendar was from the diocese of Samokov.
The development of crafts and industry in Samokov during the Revival was a consequence of the importance of the town as the biggest iron-producing center in the European provinces of the Ottoman Empire. The economic prosperity of the town in the beginning of the XIX turned it, according to the words of Constantine Irechek, into the most important town of the western Bulgarian lands and center of the education, known for his teachers and enlighteners such as Constantine Fotinov, Neofit Rilski, Hristodul Sichanov and others. N.Karastoyanov opened the first Bulgarian printing press. The new art - photography - was a measure of the economic development ad will for modernization of the population. Never fading fame of the town remains the Icon-painting School related to the names of famous painters Hristo Dimitrov, Zahari Zogtaf and others.