Origins and construction The line's origins trace back to 1870, when the Spanish government offered a concession for the Zafra–Huelva railway in a public auction, which garnered no interest. In 1878, the concession was granted to Sundheim & Doetsch, led by Spanish-German entrepreneur
Guillermo Sundheim. Initially, the line was intended to connect Zafra with the
Riotinto mining railway, operational since 1875. However, various issues led to the decision to build a new route closer to the Portuguese border. In 1879, the project was assigned to chief engineer . The final concession was granted on August 20, 1881, with a subsidy exceeding eleven million
pesetas. Sundheim began construction immediately, transferring the concession to the (ZH) in 1884. Work took place between 1881 and 1889, navigating the challenging terrain of
Sierra Morena. Most construction materials were imported by sea. The Valdelamusa–Huelva section opened on July 23, 1886, and the Zafra–Valdelamusa section on January 1, 1889. Construction was arduous, requiring nearly twenty tunnels and nineteen iron bridges, including the notable
Tres Fuentes Bridge. The 179-kilometre (111-mile) line featured around twenty stations and sidings to manage traffic. In Huelva, a major railway complex, , included a locomotive depot serving the entire line.
Peak years Although the line was not fully completed until 1889, partial operations began in 1884. Its opening connected the isolated
Andévalo region with the rest of Huelva province, benefiting numerous municipalities. It also created a rail corridor linking Extremadura provinces with a maritime port on the
Atlantic Ocean, facilitating the transport of agricultural and mineral resources. Passenger traffic exceeded initial projections, with 132,360 passengers transported in 1897. The ZH company acquired nearly thirty steam locomotives, including notable models from the British manufacturer Dübs. Guillermo Sundheim aimed to make the Zafra–Huelva railway a key route for transporting minerals to the
Port of Huelva. The presence of numerous mines along the route led to the construction of narrow-gauge branch lines connecting deposits to the railway. Over time, the line linked to mines such as , , , , , , , and . Due to differing track gauges, transshipment facilities were established for
pyrite. The and stations became primary hubs for mineral traffic, as most branch lines converged there. The El Perrunal mine generated the most pyrite traffic, with over 7.5 million tonnes transported between 1901 and 1960. Its Iberian-gauge branch line eliminated the need for transshipment. Other mines also contributed significantly: Lomero-Poyatos transported 1,553,812 tonnes from 1905 to 1960, San Telmo 1,327,275 tonnes from 1903 to 1960, and Cueva de la Mora over one million tonnes from 1888 to 1960. Passenger traffic was also significant. In 1929, a Sentinel-Cammell railcar, nicknamed the "green louse" for its speed of 80 km/h (50 mph), began operating passenger services. In 1936, the
Gibraleón–Ayamonte line opened, branching from , increasing the line's connectivity. That year, the also opened, aiming to reach the Portuguese border via
Villanueva del Fresno.
RENFE era In 1941, following the nationalization of Spain's Iberian-gauge railways, the Zafra–Huelva line was integrated into the newly formed
RENFE. RENFE expanded the locomotive fleet, incorporating steam engines from the
MZA and networks, and later "American" locomotives from
Norte. Due to poor infrastructure conditions, the track was fully renovated in the mid-1950s, and metal viaducts were replaced with concrete ones between 1954 and 1956. During this period, the line saw heavy traffic, with 421,125 passengers in 1955 and 416,995 in 1964. In the 1960s, steam traction was phased out, and passenger services transitioned to
railbuses and diesel railcars. However, the rise of road transport reduced passenger numbers. Mining branch lines, including the , closed in 1969, with the San Telmo branch shutting in the early 1970s. Mineral loading at Valdelamusa continued until February 1991. In 1976, the Huelva-Odiel station closed, and a new variant extended the line to . By the mid-1980s, despite the decline in Andévalo mining, the line maintained significant freight traffic, transporting
phosphate from
Cáceres, liquid fuels from the , and
sulfuric acid from the Minas de Almagrera plant in . Pyrite trains from the
Tharsis mines also used the line via Gibraleón. However, chronic underinvestment led to outdated infrastructure and low speeds, and RENFE classified the line as highly unprofitable in 1984.
21st century In January 2005, RENFE split into
Renfe Operadora and
Adif, with the latter assuming control of the line. By then, both passenger and freight traffic had significantly declined. Between 2004 and 2016, €48 million was invested to upgrade the Zafra–Jabugo section, including track, sleeper, and
ballast renewal. Numerous railway facilities were refurbished, and new passenger buildings and platforms were constructed. Post-2020, safety was improved by replacing the telephone block system with a
Centralized Traffic Control (CTC) system. In 2022, infrastructure upgrades began on the Valdelamusa–Huelva section. In summer 2023, the line was closed to replace five bridges, extending their lifespan. == Route and features ==