A railway line washed away by Storm Ciara in February has finally reopened after £2.2m of repairs.
The Conwy Valley Line links the Gwynedd town of Blaenau Ffestiniog with Llandudno on the coast but has been closed since flood-water damaged it.
It is at least the sixth time flooding on the stretch has forced it to close in the past 20 years.
Storm damage means the line has been closed more than it has been open in the past 18 months.
Network Rail said it had installed 16,000 tonnes of rock armour alongside a lengthy section of the railway between Tal y Cafn and Llanrwst to protect the railway during what it said were "ever more frequent flooding events" in the Conwy Valley.
According to rail officials, the rock armour works by slowing down the water to prevent it carrying away the railway embankment.
If that happens, the track is exposed and suspended in the air and is unable to support the weight of trains.
Bill Kelly, Network Rail's route director for Wales and Borders, said: "I am delighted that the Conwy Valley Line is now better protected as extreme weather has forced it to be closed too often in recent years.
"We have worked around the clock in recent months to not just repair the line, but to make it more resilient so we can help to prevent these long closures in the future."
Engineers said the new rock armour had already been tested by Storm Francis, which hit the area at the end of August.
Access to the site was flooded and ended up under water, but the railway came through unscathed.
"I would like to thank passengers and the communities we serve along the line for their patience as this significant investment was delivered," said Mr Kelly.
UK Rail Minister Chris Heaton-Harris said: "The Conwy Valley line is a vital link for many local communities in north Wales, and this investment will improve the resilience of that crucial route during extreme weather.
"Upgrading the railway defences will help prevent lengthy closures for passengers, avoid frustrating rail replacement services, and deliver a more reliable timetable people can depend on."