LONDON -- A passenger train hit a landslide before derailing in Scotland earlier this week, killing three people, U.K. rail investigators confirmed Friday.

A train track obstruction had been suspected of playing a role in Wednesday's derailment near the coastal town of Stonehaven, about 100 miles (160 kilometres) northeast of Edinburgh, because it happened after heavy rain and flooding in the area.

"Thankfully, fatal derailments are a rare occurrence on the U.K.'s national network," Simon French, chief inspector of rail accidents, said. "However, landslips and other earthworks failures remain a risk to trains that needs to be constantly managed -- and this is becoming even more challenging for the rail industry due to the increasing incidence of extreme weather events."

The Rail Accident Investigation Branch, which French oversees, said that after the train derailed, it kept going in a straight line as the track curved to the right. The lead power car struck a bridge parapet and fell down a wooded embankment with the third passenger car.

Prince Charles is visiting the accident site Friday to thank emergency workers who came to help others in rugged terrain.

Infrastructure manager Network Rail dispatched engineers, contractors and surveyors in helicopters to assess sites similar to the location of the derailment.