The West Coast Main Line contract has been cancelled because of mistakes by Government officials in a move that will cost the taxpayer £40m.
Transport Secretary Patrick McLoughlin has dramatically ripped up a deal that handed the responsibility for running one of Britain's busiest railways to FirstGroup.
In a major embarrassment for the Government, he conceded the U-turn was down to "deeply regrettable and completely unacceptable mistakes" in his own department.
Three officials from the Department for Transport (DfT) have now been suspended and two independent reviews into the competition process have been launched.
Labour leader Ed Miliband told Sky News that the development was "appalling" and a sign of more "incompetence" from the coalition, which he insisted had to "get a grip".
The flaws relate to how the level of risk in the different bids was evaluated before a final decision on which to adopt was made.
There were mistakes in the way inflation and passenger numbers were factored in, which then affected how much money bidders were asked to put up as a guarantee.
Virgin Trains boss Sir Richard Branson had been furious at losing out to FirstGroup, calling the decision "insane", and was seeking a judicial review.
But barely 24 hours before a High Court hearing in the case, he was called by Mr McLoughlin late on Tuesday to be told the contract was being scrapped.
Sir Richard told Sky News the process had been an "absolute fiasco" and said the company had always been confident it had right on its side.
"Everybody at Virgin Trains is delighted. The last thing we wanted to do was go to court," he said, speaking from the US.
"It has been four months of non-stop process for everybody at Virgin Trains but we are glad that right prevailed in the end."
The businessman, who stressed he did not want to apportion blame, said Virgin would probably bid again as long as it was confident the rules were fair.
The mistakes in Whitehall were only revealed because officials were gathering evidence for the court case, suggesting they may not have been uncovered for some time had there been no challenge.
DfT permanent secretary Philip Rutnam said: "The errors exposed by our investigation are deeply concerning. They show a lack of good process and a lack of proper quality assurance.
"I am determined to identify exactly what went wrong and why, and to put these things right so that we never find ourselves in this position again."
At the time FirstGroup was granted the franchise, then Transport Secretary Justine Greening described the bidding process as "robust" and "fair".
FirstGroup had been due to take over the running of the London to Scotland line on December 9 and run the service for at least 13 years.
The Government says it is "resolving urgently" what will happen now and attempted to reassure passengers.
Mr McLoughlin said: "West Coast passengers can rest assured that while we seek urgently to resolve the future arrangements the trains that run now will continue to run, with the same drivers, the same staff and timetables as planned.
"The tickets that people have booked will continue to be valid and passengers will be able to make their journeys as planned."
The four companies who competed for the deal will have to their bid costs refunded and a review of how the process went wrong will report by the end of the month.
A second investigation into the wider rail franchise programme is due by the end of December.
The three other outstanding rail franchise competitions - Great Western, Essex Thameside and Thameslink - have been suspended while the probes are carried out.
FirstGroup, whose shares were down 18% at one point on Wednesday, said it had no clue there had been anything wrong with the process until it was contacted by the Government.
"We are extremely disappointed to learn this news and await the outcome of the DfT's inquiries," a spokesman said.
"The DfT has made it clear to us that we are in no way at fault, having followed the due process correctly. We submitted a strong bid, in good faith and in strict accordance with the DfT's terms."
Shadow transport secretary Maria Eagle called on Mr McLoughlin to reveal the full details about what happened and branded the situation a "shambles".