The Valmorea railway connected the great industrial centres of the Varese area with Switzerland via the Olona Valley and the Lanza River.
The first section of this steam railway line opened in 1904, when Società Ferroviaria Novara-Seregno built the 10.52 km long Castellanza-Cairate-Lonate Ceppino line. In addition to Castellanza station, there were stops at Marnate, Prospiano and stations in Gorla Minore, Solbiate Olona, Gorla Maggiore, Fagnano Olona, Cairate, and Lonate Ceppino.
The line’s importance lay in its ability to transport goods in an area where the vicinity of the Olona River had encouraged the establishment of textiles factories such as the cotton mill in Solbiate or the Candiani plant, which had its very own stop.
An agreement signed in 1913 was to extend the railway from Cairate - Lonate Ceppino to the Swiss border. Construction began before the First World War, but only the first section, up to Valmorea, was opened in 1916. It ran through the Olona Valley to Malnate and from there to Valmorea along the Lanza River. On the line were the stops and stations of Gornate Olona, Castiglione Olona, Lozza, Ponte Vedano, Bizzozero, Malnate, Cantello and Valmorea.
On the 1st of January 1918, operation of the Valmorea railway was handed over to Società anonima Ferrovie Nord Milano. Because of the war, the 2 km final section of the line, joining Valmorea station to the Swiss border, was not completed until 1926, connecting to the Stabio-Mendrisio line in the Swiss Confederation.
The completed railway had become an international line. It offered a new gateway to Italy via the Gotthard Pass, and its importance for the two countries was acknowledged by their governments, who signed an agreement to ensure its operation. But lack of traffic on the Swiss section, due primarily to the refusal of the Italian national railways to route goods through Valmorea, led to the closure of the line in 1928. The final section, from Valmorea to the Swiss border in Italian territory, was suspended as a result.
In November 1938 suspension of passenger service on the entire line was authorised, and it was used only to transport goods, with a single shunting move on working days only, at first as far as Malnate and then only as far as Castiglione Olona, leaving the track in place between Castiglione and Malnate as a siding for the Conti workshop in Malnate.
Despite the talk of reopening it to international traffic, only the Castellanza-Castiglione Olona segment of the Valmorea line survived until 1977, for goods service only.