Sir Richard Branson's rail company Virgin Trains has been awarded the West Coast main line contract for a further 23 months, it has been announced.
Branson welcomed the "great news" on Twitter, writing the extension was a reward for his team's "hard work and bravery".
Virgin had been set to lose the West Coast franchise it has operated since 1997.
But the government scrapped the bidding after Department for Transport (DfT) faults were found with the bidding process.
Virgin Trains had been set to lose the West Coast Main Line franchise
Thursday's temporary deal will see Virgin carry on with the London to Scotland route until November 9, 2014, after which the West Coast line will be let under a long-term franchise.
The government has altered its plans for the immediate future of the line, in that the Virgin temporary deal is for far longer and there will be no interim franchise before the long-term one is introduced.
However the deal comes with the caveat that the DfT would be able to shorten the 23-month period by up to six months "if a subsequent franchise can be let on a shorter timescale".
Richard Branson had offered to run the train line on a not-for-profit basis
Transport company Stagecoach, which has a 49% stake in Virgin Rail, said that under the new agreement, Virgin will initially earn a fee equivalent to 1% of revenue with the DfT taking the risk that revenue and/or costs differ from those currently expected.
It added that Virgin and the DfT had agreed to seek to negotiate revised commercial terms that would see Virgin take greater revenue and cost risk for the period to November 2014 for a commensurate financial return.
Stagecoach finance director Martin Griffiths said: "This is a good deal for passengers and taxpayers, as well as our business and Virgin Trains' employees.
"It is now crucially important that the rail franchise programme gets back on track on a sustainable basis as soon as possible."
Virgin had high hopes of extending its long tenure on West Coast when bids were invited for a new 13-year franchise which was due to start on December 9 this year.
But in August the DfT announced the new franchise had gone not to Virgin but to rival transport company FirstGroup.
It was only after Sir Richard, who had branded the bidding process "insane", mounted a legal challenge to the decision that Transport Secretary Patrick McLoughlin, scrapped the bidding process, saying there had been mistakes by the DfT.
Three DfT officials were suspended and negotiations were started with a view to getting Virgin to run the line for between nine and 13 months before a short interim franchise was offered followed by a longer one later.
When he pulled the plug on the West Coast franchise bidding, Mr McLoughlin appointed businessman Sam Laidlaw to produce an independent report into the fiasco.
After producing damning initial findings, which listed failings by the DfT, Mr Laidlaw presented his full report to the department last week.
But with one of the suspended department officials, Kate Mingay, mounting a legal challenge to her suspension, Mr McLoughlin announced that he was delaying the Laidlaw report publication until this week, with publication likely later today.
Mr Laidlaw had been due to appear before the House of Commons Transport Committee this week, but MPs will now hear his evidence on December 18.
The committee's chairman, Louise Ellman, criticised the DfT over the delay and the RMT transport union has been upset that the department did not take the opportunity to take the West Coast line into public ownership.
Mr McLoughlin has ordered an independent inquiry into the franchise system, while halting existing bidding processes.
Virgin Rail Group chief executive Tony Collins said the company would install "even better service" on the line.
"We will not be sitting back in the coming months, but are keen to introduce more improvements to the service."
The RMT union had been hoping that due to the West Coast franchise fiasco, the DfT might approve overseeing the running of the line in the public sector, as is the case for the time being with the East Coast line.
General secretary Bob Crow said: "Richard Branson has muscled his way into a monopoly provider position on this main line route and has extracted a longer extension than expected, leaving it wide open to legal challenge.
"Meanwhile, pure right-wing ideology stopped this sub-Thatcherite Government from using the safe, efficient and cost-effective option of renationalising the West Coast."
The botched franchise process on West Coast is costing taxpayers at least £40m - money which Mr Crow said could have been used to invest in services.
The cost to the public could rise should FirstGroup, whose shares dipped when the bidding was cancelled, seek damages.
Transport Secretary Patrick McLoughlin said: "We are determined to ensure not only that passengers continue to experience the same levels of service they have in the past, but that services improve.
"There will be a new hourly service linking Glasgow and London and we will also work with Virgin Trains to explore other service improvements."
He went on: "I am also extremely pleased that passengers will benefit from up to 28,000 more seats daily thanks to the delivery of 106 new Pendolino carriages on to the West Coast line which has happened on budget and ahead of schedule."
Suggested For You
Get top stories and blog posts emailed to me each day. Newsletters may offer personalized content or advertisements. Learn more