Statistics published by the Office of Rail Regulation indicate an increase in the popularity of the Fort William to Mallaig train, which runs over the bridge that famously features in the series.
The Hogwarts Express travels over the viaduct as it takes pupils to school in the film adaptation of JK Rowling’s novels.
With more than 1,000 visitors flocking to Glenfinnan Station in 2017-18, ScotRail has now announced it will build a new footpath to help handle the volume of people.
Meanwhile, a walkway that crosses the hillside between the railway station and the viaduct will be upgraded to provide easier access to several new viewing areas, allowing tourists to capture the stunning scenery.
The project will be a working partnership between ScotRail, the West Highland Community Rail Partnership (WHCRP), Glenfinnan Station Museum, Glenfinnan Estate, Network Rail and Transport Scotland.
It is hoped the work helps to increase the proportion of visitors arriving by public transport by improving the facilities available.
ScotRail project manager Anouska Chisolm said: “The new footpath and viewing areas at the Glenfinnan Viaduct will be fantastic for tourism in the area and we hope it will encourage more visitors to travel here by rail instead of car.
“It’s important that we continue to work with our key partners on how we can boost tourism and bring wider economic benefits along Scotland’s most scenic railways.”
Skye, Lochaber and Badenoch, MSP Kate Forbes, said: “It’s fantastic to see more people choosing to go on the ‘Harry Potter line’ and experience the fantastic scenery at the Glenfinnan Viaduct, as well as the breathtaking views from Fort William to Mallaig generally.
“Ultimately, I would like to see more people using public transport instead of driving as it reduces congestion and its good for the environment.
“That means that public transport needs to be reliable, comfortable and regular.
“I would like to see ScotRail invest more significantly on this line and capitalise on the clear growth in tourism the area is experiencing.
“Strategically, especially given the frequent delays with Fort William traffic in the peak summer months, it makes sense to get more people off of the road and on to trains.”