The history of the town is closely linked to the village of Stari trg, where a Roman settlement named Colatio existed during the Classical period. The mediaeval castle above Stari trg was first recorded as Grez (‘Gradec’) in 1091, thus being the second earliest castle in the Slovene Styria and Carinthia as to the records. The name was transferred to the nearby developing settlement that took advantage of the more favourable location on a 10 m high sandbank terrace between the rivers Suhodolnica and Mislinja, while the settlement directly beneath the castle came to be known as Stari trg (‘Old Borough’).
Slovenj Gradec was established by the Counts of Andechs, who took over the Dominion of Slovenj Gradec at the end of the 12th century, the area having been a separate unit between the provinces of Carinthia and Styria until the 15th century. It was first recorded as a borough in 1251 when Berthold of Andechs, the Patriarch of Aquileia, donated all his estates in the area of Slovenj Gradec: the castle with the church, the borough and other places including the ministerials and subject as well as the toll-house and the mint, to the Patriarchate of Aquileia (in present-day Italy).
Due to the great distance between Slovenj Gradec and Aquileia, the nearby feudal lords took part in the struggle for the Dominion of Slovenj Gradec. The authority over it was assumed by Duke Ulrich III, Spanheim of Carinthia, who granted civic deeds to Slovenj Gradec in 1267. Subsequently, the town had been in the possession of Otokar II, King of Bohemia, for some time before the Patriarchs of Aquileia resumed their authority over it once again.
The family of Windischgrätz, who arrived from Upper Bavaria as ministerials to the Counts of Andechs, was one of the interesting families that resided in Slovenj Gradec. Subsequently, they became one of the most prominent families in the Habsburg Empire.
Due to its favourable geographic location and transit routes, the town of Slovenj Gradec began to flourish. Various crafts and trade expanded, town walls were built, and the town was granted fair deeds and judicature as well as a mint.
The Habsburgs contributed to the town's further development after they took over the Dominion of Slovenj Gradec in the second half of the 14th century and enfeoffed it to various feudal lords of Styria, so in 1407 the Estates became part of the province of Styria. The judicature of the town expanded, the development of crafts and trade in its surroundings was regulated and a significant storehouse for salt from the area of Salzburg was built in the town. The salt border ran along the Slovenj Gradec area: salt from Aussee in Styria was sold exclusively to the north of the salt border, whereas sea salt was sold to the south.
New possibilities for travelling emerged for the inhabitants of Slovenj Gradec with a new attitude towards the knowledge brought about during the late Middle Ages. Piligrin, the parish priest of Slovenj Gradec, studied in Bologna, Italy, as early as the 14th century, while Nicholaus of Slovenj Gradec lectured at the University of Vienna in the second half of the 15th century to become the first Chancellor there from the present territory of Slovenia in 1437. In the 1470s, as many as four students from Slovenj Gradec studied at the University of Vienna, among them was Matthaeus Cerdonis de Windischgretz (ca. 1445-1487 or after), the last independent printer of incunabula in Padua, Italy. Over 60 of his prints have been established thus far, from the fields of medicine, mathematics and astronomy, as well as law and the humanities.
In the Late Middle Ages Slovenj Gradec was also a desirable destination that attracted people; some arrived as settlers (e.g. the wealthy citizen Johannes von Lakh who established the town almshouse), others as artists (e.g. Andreas of Otting, the painter of frescoes in the Church of the Holy Spirit), many of them as travellers (e.g. Hugo Blotius) or visitors (e.g. Maximillian I, King of the Holy Roman Empire, who spent a few days in Slovenj Gradec in 1514)
During the 15th and 16th century, Slovenj Gradec was not exempt from the events that shaped the history of continental Europe: the country was ravaged by the Turks, the valley was devastated by locusts in 1477, and the town was occupied by the soldiers of Matthias Corvinus, King of Hungary, in 1489 and subsequently intensely seized by the first wave of the Reformation in 1525. The new faith was adopted by most of the citizens and aristocrats from the surrounding area. The movement was finally surpressed by a Counter-Reformation commission that burnt all Lutheran books and pulled down the small church and churchyard as late as 1600 (and the Catholic faith was reinstated). Nevertheless, the name of the town – Slovenj Gradec – that was first written in its Slovene form by Primož Trubar (a leading Protestant and the founding father of the Slovene language) has remained as an abiding legacy of Protestantism.
In the following centuries the town was restored. Apart from trade and various crafts, the arts developed as well, so Slovenj Gradec became a significant centre of arts and crafts in the 17th and 18th century. Numerous craftsmen – especially gilders and engravers – served the needs of the citizens, while painters and sculptors redecorated the churches. Various masters had their workshops in the town at the time: Michael Scobl, Franz Michael Strauss, his son Johannes Andreas Strauss as well as the sculptor and fretwork master Johann Georg Mersi. The cultured appearance of the town was additionally enhanced by artists from other parts of the country (e.g. Johann Jacob Schoy). It is worth mentioning that masters of the Baroque workshops of Slovenj Gradec decorated the churches in numerous places in the Slovene part of Styria.
During the 19
th century, Slovenj Gradec developed into a town in the modern sense of the world. The houses in the centre acquired a more modern and sumptuous appearance according to middle-class taste; some of them have been preserved to the present day despite the fire in 1903. The town was the seat of the District Governor and judicature, scales and measurements bureau, gendarmerie, school, almshouse, hospital, two hotels and several inns. A new hospital was built in 1898 and electric lighting powered by its own plant was introduced in 1903. The first train reached the town in 1899, to be followed by four cars and eight motorbikes only a decade later.