Updated

Harry Potter fans love checking out the real world sites featured in the films.

Whether it’s the real-life Reptile House at London Zoo where a python first spoke to Harry, London’s Leadenhall Market which doubled as Diagon Alley, or the imaginary Platform 9¾ at Kings Cross station, if it's been featured in the Harry Potter films, you can bet it’s become a major tourist attraction.

Glenfinnan Railway Viaduct

The Glenfinnan Railway Viaduct in Scotland with the Jacobite steam train passing over. (iStock)

But there’s one landmark that seems to be landing Harry devotees into big trouble.

HOW TO CELEBRATE HARRY POTTER'S 20TH ANNIVERSARY IN THE UK

Police in the UK are warning Harry Potter fans against walking along the live railway track in the Scottish Highlands, where the Hogwarts Express can be seen chugging along on screen.

There has reportedly been an increase in the number of intrepid fans crossing the Glenfinnan Viaduct, which services the Jacobite steam train, and police warn they’re putting themselves in serious danger.

British Transport Police said it understands the fascination with the viaduct but “people do not have any magical powers so there is nothing to protect them from being injured or killed by a passing train," the BBC reported.

Sgt Kevin Lawrence reiterated,“Tourists from all over the world travel on the Jacobite steam train during the summer months to visit the famous Glenfinnan Viaduct.

“Alarmingly, visitors often get off the train at Glenfinnan and walk back along the line to take photographs. This is extremely dangerous.

He added: “Much as we love Harry Potter, I would like to remind everyone that we are mere Muggles, and if you trespass on the railway and are struck by a train, the consequences could be extremely serious and probably fatal.”

FOLLOW US ON FACEBOOK FOR MORE FOX LIFESTYLE NEWS

A rise in the popularity of the viaduct is partly behind a 16 per cent rise in railway trespassing offenses in Scotland last year, police said.

And there have been a number of close calls. Five years ago, a steam train driver was forced to brake after seeing two women standing dangerously close to the train line, the BBC reported.

And in 2015, a couple and their child were seen running along the railway line.

This story originally appeared on news.com.au.