An investigation has been launched after a freight train laden with fuel derailed and burst into flames as it crossed a bridge. Flames shot 50ft into the air and a huge plume of thick black smoke drifted above the crash scene near Stewarton in Ayrshire. The bridge partially collapsed and an exclusion zone was set up around the area. Fire chiefs said it was "very, very lucky" that there had not been a major disaster. Locals told of seeing a fireball after the accident which happened shortly after 6am today. Six of the 10 wagons were derailed and one caught fire, British Transport Police (BTP) said. The 45-year-old male driver was not hurt and no other injuries were reported. The BP rail wagons were carrying heating oil and diesel from the Grangemouth refinery to a Scottish Fuels terminal in Kilmarnock when the train derailed. The locomotive remained upright. The bridge was due to be demolished this weekend so that the rail route could be upgraded from single to double track. Network Rail said it was found to be structurally sound following an inspection last February. A spokesman said: "The bridge was inspected last February and we have no reason to believe that it was anything but structurally sound before this incident." The train, which was operated by DB Schenker, hit a pylon after it came off the rails. Up to 100 local homes in the Kilmaurs area of Ayrshire lost power as a result.