For 120 years, the Rubjerg Knude lighthouse has been perched on a sand dune on the northern Danish coast, but coastal erosion from North Sea winds threatened to topple it into the sea.
Now the 720-tonne structure has been saved, in an operation to lift it up and move it 70m (230ft) inland "like skates on rails".
Within hours, the lighthouse was transported to its new position.
Local builder Kjeld Petersen said the move would be over by mid-afternoon.
"We could not go faster than 12m an hour because they needed to calibrate the hydraulics. It's in sand and you need to ensure it runs well on the two rails," explained Mette Ring, from the local authority.
The engineers had assumed the lighthouse weighed up to 1,000 tonnes but discovered as they lifted it on Tuesday that it was a mere 720 tonnes and therefore a little easier to move.
Why it was moved
Rubjerg Knude is a popular tourist site, attracting some 250,000 people a year to the sand dunes of the island of North Jutland.
"It's in the middle of a gigantic sand dune and you can see it at night. It's windy and rough and you can really feel the elements here," said Ms Ring.
When coastal erosion affected a church along the coast, residents realised that they would have to dismantle the building rather than allow it to fall into the sea.
The North Sea had also eaten into the cliff on which the lighthouse stood, leaving it only a few metres from the edge. With only a year or two left before the 23m-high lighthouse faced the same fate, another approach was adopted.
The local authority, with government funding of 5m Danish Kroner (£0.6m; €0.7m; $0.75m), decided to move it 70m inland, to give the lighthouse a 40-year reprieve.
The operation, involving Mr Petersen and a local engineering firm, took 10 weeks to plan. Beams were inserted into the base of the lighthouse, which was then raised on to parallel rails and moved away from the sea.
Originally, the lighthouse stood 200m from the sea, but erosion has reduced that by 2m a year. The area around the lighthouse will now be filled with cement.