A 120-year-old lighthouse in Denmark, at risk from North Sea erosion of the country’s north-west coastline, was on Tuesday wheeled back from the cliff edge.

When the 23-metre (75ft) Rubjerg Knude lighthouse was first lit in 1900, it was roughly 200 metres from the coast; that distance shrank to six metres.

Arne Boelt, the local mayor, said many things could go wrong when moving the defunct building, which weighs about 1,000 tons and sits on a cliff. “But it’s worth the risk ... the alternative would be to dismantle the lighthouse.”

The lighthouse move is expected to last 10 hours, at a speed of eight metres per hour. Photograph: Henning Bagger/Ritzau Scanpix/AFP via Getty

The Danish environment minister, Lea Wermelin, called the lighthouse “a national treasure” in an attempt to justify the 5m kroner (£580,000) spent by the ministry to save it. Boelt and the town of Hjørring also have chipped in to foot the bill.

Moving the lighthouse, with the help of rails and wheels, was expected to last 10 hours, at a speed of eight metres an hour. The building in its original position was at risk from erosion and shifting sands.

The lighthouse ceased operating in 1968, when sands slowly buried two adjacent buildings, and was briefly turned into a museum. The surrounding dunes still attract more than 250,000 visitors each year.

A sandstorm at the Rubjerg Knude lighthouse in 2015 Photograph: Redphotographer/Getty Images/iStockphoto

The move, broadcast live on Danish news outlets, depended on the weather, which was currently fair in the region. Thirty minutes into the operation, the lighthouse had been moved 1.4 metres.

In 2008, a nearby church was dismantled to prevent it from falling into the sea. The Romanesque Mårup church, built in about 1250 on a cliff, was used as one of the filming locations for the 1987 film Babette’s Feast, which became the first Danish film to win an Academy award for best foreign language film.