By the end of the 19th century, Monastir had become the most flourishing economic centre in western Macedonia and an important Turkish army base. Plans for its connection by rail with Thessaloniki came to fruition in 1890.
In the autumn of that year, Alfred Kaoulla, a German banker and broker for the sale of Mauser weapons, secured permission from the Ottoman authorities and financial backing from the powerful Deutsche Bank to construct the coveted link.
Its commissioning, which was granted under incredibly favourable terms, provided for the line to pass through the most important cities in western Macedonia: Veroia, Naousa, Edessa and Florina. Construction proved exceptionally difficult owing to the many rivers, the rough terrain, and malaria, which decimated the Italian workers in the mountains of Edessa and other lakeside marshy areas. After many delays, the line was opened to traffic on 15 June 1894.
The commercial realignments it brought about were extremely serious, and even had an impact on the Albanian economy. However, none of the immediate consequences was more important than that of the meteoric development of the yarn industry, which remained the most vital branch of western Macedonia's economy until the mining of lignite began.