Flying Scotsman Borders Railway and Forth Bridge trip back on
The Flying Scotsman will be allowed to run on the Borders Railway and Forth Bridge on Sunday after a climbdown by Network Rail.
Excursion operators had been told on Friday the trip must be cancelled because it could not be sure the engine was suitable for the line.
Network Rail chief executive Mark Carne apologised and said an investigation would take place.
Scottish Transport Minister Derek Mackay branded the affair a "debacle".
Hundreds of steam enthusiasts are planning to turn out to watch the newly-restored locomotive run on the Borders line, which re-opened last September.
Late on Friday afternoon, however, Network Rail said it it did not have the right data to "gauge" the Flying Scotsman - a process which involves checking if it fits within structures such as platforms and bridges on the line.
A planned trip across the Forth Bridge into Fife later in the day was also cancelled for the same reason.
Network Rail reversed its decision on both journeys less than 24 hours later, after intensive lobbying.
Network Rail chief executive Mark Carne said: "Overnight and through today our engineers and analysts have worked hard to find a way to get the necessary safety checks and engineering assessments done.
"I am pleased to say that we have been successful and are now able to reinstate the original planned tours of Flying Scotsman in Scotland on Sunday.
"I wholeheartedly and sincerely apologise for the consternation caused by the premature announcement yesterday.
"Once the tours have been safely and successfully run, I will be instigating a full investigation into how this problem occurred on our railway in Scotland."
Transport Minister Derek Mackay had earlier accused the rail body of "appalling incompetence" and described the situation as a "debacle".
He later tweeted: "Solved. Flying Scotsman will run on Borders and Fife. Questions remain on how it came to this, but thanks a solution was found."
The leader of Scottish Borders Council David Parker praised the efforts to resolve the deadlock.
"The Flying Scotsman will visit the Borders tomorrow as planned," he said.
"All of the planned events at Galashiels and Tweedbank are back on. The Flying Scotsman is coming and the problems have been resolved.
"ScotRail have worked tirelessly over the past 24 hours and in that period of time have managed to sort out problems that Network Rail couldn't do in 12 weeks.
"There's been incredible partnership working and some fantastic work done by the team in Scotland and I can't praise them enough
"But the message to Borderers and the many people coming to visit our regions is that all the work behind the scenes has paid off. The Flying Scotsman's coming and all events are back on."
The locomotive is due to arrive at Edinburgh Waverley Station later on Saturday, ahead of the Borders and Fife trips.
Built in Doncaster, South Yorkshire, in 1923, the Flying Scotsman pulled the first train to officially break the 100mph barrier in 1934.
The National Railway Museum in York bought the locomotive for £2.3m in 2004 before work got under way on its decade-long restoration two years later.
In February Network Rail was forced to pay out almost £60,000 in compensation when dozens of train services were delayed by people encroaching on the track during the refurbished train's inaugural run from London to York.