A Grade II listed viaduct will shut on Friday for a £25m renovation project to begin.
Rather than face one long closure, Barmouth Viaduct will close three times for short periods.
The entire length of track on the structure will be replaced, along with a large number of the timber and metal elements.
Built in 1864 and 2,690ft (820m) long, Network Rail says Barmouth is its only major timber‐built bridge still in use.
The viaduct, on the Cambrian coast rail line between Pwllheli and Machynlleth, was originally built with a drawbridge which was replaced with a steel swing-bridge in 1900.
Bill Kelly of Network Rail said it would be the bridge's biggest upgrade in its history, adding: "Barmouth Viaduct is one of the most celebrated and recognisable structures in Wales."
It will shut from 23:40 BST on Friday until 05:30 on 2 November. Further closures will follow in 2021 and 2022.