Narrow gauge lines were nationalized in the 1950s, later being grouped to form FEVE. The history of rail transport in Spain begins in 1848 with the construction of a railway line between Barcelona and Mataro, in 1852 the first narrow gauge line was built, in 1863 a line reached the Portuguese border.