The story
The first railway in Portugal was between Lisbon and Carregado, now referred to as the Linha do Norte; it opened on 28 October 1856. It was extended to Porto, joining Portugal's two largest cities, in 1877.
Meanwhile, on 1 February 1861 the lines between Barreiro Pinhal Novo and Vendas Novas (the Linha do Alentejo) and between Pinhal Novo and Setúbal (the Linha do Sul) followed.
The Linha do Sul, at 274 km was the principal main line in the south of the country, but it terminated short of Lisbon on the south side of the river Tagus (Tejo in Portuguese) but it received a considerable improvement when it was extended from Pinhal Novo to Lisbon over the Ponte 25 de Abril, which was provided with an additional railway deck.
The earliest railways in Portugal were built to standard gauge (1,435 mm) but were regauged in the nineteenth century for compatibility with the trains of the railways of Spain, which at that time used a track gauge of 1,668 mm.
First electrification in Portugal was the suburban line from Lisbon to Cascais, at 1,500 V d.c., but it was another 30 years before the next electrification, the Norte line between Lisbon and Carregado, on 28 October 1956, exactly 100 years from the line's opening. This electrification was at 25 kV 50 Hz.
Through routes to Spain are single-track and are not completely electrified.
From Wikipedia’s article on Rede Ferroviária Nacional, shared under CC BY-SA 4.0.4