The first section of the line is the Milan–Monza line, which was opened by the Kingdom of Lombardy-Venetia (part of the Austrian Empire) as the Imperiale Regia Privilegiata Strada Ferrata da Milano a Monza ("Imperial Royal Privileged Railway from Milan to Monza") on 18 August 1840, the second railway opened in Italy after the Naples–Portici railway line. The government originally intended to permit the line to be extended to Bergamo, but had intended that a separate concession be granted for a line from Milan to Como. Instead, it decided to scale down the project by allowing the Monza line to be extended to Como. On 10 October 1849 line was opened from Monza to Camnago in Lentate sul Seveso and it was extended to Camerlata on 6 December. The line was completed to Como in 1875. It was part of the Società per le strade ferrate dell'Alta Italia (Upper Italian Railways) from 1865, the Società per le Strade Ferrate del Mediterraneo (Mediterranean Railway Company) from 1885 and Ferrovie dello Stato from 1905.