Founded by Christian settlers who after the Ottoman conquest withdrew from the plains of Macedonia into the mountains, Kozani occupies the site of an ancient town as archaeological finds in the area testify. Its safe position soon attracted other Christians expelled from Epirus. With the 17th century came economic development and urbanization.
Around the middle of the same century, Kozani was pillaged by Turks from the vicinity, but two large waves of immigrants from Epirus about the same time changed the face of the town. Kozani's growth and prosperity are linked with Harisis Trantas (the son of Ioannis Trantas who had led one of the groups from Epirus), "a good mason and builder who came to build stately homes of two storeys," as one old document states, having secured privileges by placing the town under the protection of the Sultan's mother.
In 1664 the foundations were laid for the magnificent church of Ayios Nikolaos and the market, which housed the workshops of local craftsmen and the shops of the guilds and Greek merchants from central Europe. The commercial development of the 18th and 19th century also contributed to the growth of education and the arts.