Media playback is unsupported on your device Media caption Branson: Virgin 'likely' to keep running the West Coast Main Line

The decision to award the UK's multi-billion-pound West Coast Main Line rail franchise to FirstGroup has been scrapped by the government.

The transport secretary said there were "significant technical flaws" in the bidding process because of mistakes by Department for Transport staff. Three civil servants have been suspended.

The estimated cost of reimbursing four companies for the cost of their bids will be £40m, Patrick McLoughlin said.

FirstGroup said it was "disappointed".

The company had beaten current operator Virgin Trains to win the 13-year franchise.

The West Coast route serves 31 million passengers travelling between London, the West Midlands, the north-west of England, North Wales and the central belt of Scotland.

Mr McLoughlin emphasised that the companies had done nothing wrong during the process. The "fault lies wholly and squarely with the Department of Transport", he said.

Writing on his blog, Virgin founder Sir Richard Branson welcomed the move, details of which emerged in the early hours on Wednesday.

He said he was hopeful ministers would "now accept that Virgin Trains should carry on running the West Coast Main Line".

Analysis This dramatic, midnight admission by the government that it failed to judge the West Coast Main Line bid properly is deeply embarrassing. When the franchise was handed to First Group the then Transport Secretary Justine Greening insisted the government would push on with a process it insisted had been robust and fair - in the face of angry objections by Virgin, the Labour Party and the thousands of people who signed a petition calling for the bid to be reconsidered. She lost her job in the reshuffle. The new Transport Secretary, Patrick McLoughlin, told the Commons as recently as 12 September he was satisfied all bids were considered fairly and with "due diligence". Now, the day before Virgin's High Court legal challenge was due to start, the Department of Transport has admitted to "completely unacceptable mistakes." Its rail franchising policy is in chaos.

Four companies submitted bids 15 months ago - Virgin, FirstGroup, Dutch train operator Nederlandse Spoorwegen, and a joint bid from French companies Keolis and SNCF.

BBC transport correspondent Richard Westcott says the implications of the decision to scrap the deal go much further than just the West Coast Main Line.

There were about 15 rail franchises due to be decided before the next general election and the whole franchising process could now be thrown into doubt, he added.

The August announcement that FirstGroup would take over train services on the line - one of Britain's busiest - in December had sparked a legal challenge from Virgin, which has run the franchise since 1997.

The Department for Transport said because of the decision to rerun the bidding process it would no longer be contesting the judicial review launched by Virgin Trains in the High Court.

Virgin will continue to operate the line while the issue is resolved.

Mr McLoughlin, who became transport secretary just three weeks ago, described the mistakes made by his department as "deeply regrettable and completely unacceptable".

Media playback is unsupported on your device Media caption Transport Secretary Patrick McLoughlin: "It is going to cost us a lot of money"

He said: "A detailed examination by my officials into what happened has revealed these flaws, and means it is no longer acceptable to award a new franchise on the basis of the competition that was held."

The department said the "flaws stem from the way the level of risk in the bids was evaluated. Mistakes were made in the way in which inflation and passenger numbers were taken into account, and how much money bidders were then asked to guarantee as a result".

West Coast Main Line franchise 15 August 2012 Virgin Rail loses franchise as FirstGroup awarded it by Department for Transport

Virgin Rail loses franchise as FirstGroup awarded it by Department for Transport 26 August Virgin Rail boss Richard Branson offers to run franchise "for free" while process is reviewed

Virgin Rail boss Richard Branson offers to run franchise "for free" while process is reviewed 28 August Virgin Rail launches legal challenge over contract process

Virgin Rail launches legal challenge over contract process 3 October Department for Transport unexpectedly scraps contract with FirstGroup after flaws in process discovered. Two reviews ordered, and process to be re-run

Department for Transport unexpectedly scraps contract with FirstGroup after flaws in process discovered. Two reviews ordered, and process to be re-run 9 December New contract for West Coast Main Line due to begin, lasting till 2026 Q&A: West Coast Main Line franchise

BBC business editor Robert Peston says the department made unrealistic assumptions about the growth of passenger numbers and inflation towards the back end of the franchise period.

This had the effect of making First Group's bid seem significantly more attractive, he added, because the company was much more optimistic about how passengers and revenues could grow after 2021.

The government has ordered two reviews. One will examine how the West Coast franchise competition went wrong, and what lessons could be learned. It will be headed by Sam Laidlaw, a non-executive director of the department, and is expected to report by the end of the month.

The other review will look into the wider Department for Transport rail franchise programme, and will be overseen by Eurostar chairman Richard Brown. His report is expected by the end of December.

The suspended staff face possible further disciplinary action pending an investigation.

Three other franchise competitions had also been "paused" in light of the West Coast Main Line situation, Mr McLoughlin confirmed.

"I want to make sure what lessons need to be learnt from what went wrong with this have not been repeated in those particular franchises."

'Frank announcement'

FirstGroup said that it had had "no indication" of any problems until it was contacted by the Department for Transport.

"We are extremely disappointed to learn this news, and await the outcome of the DfT's inquiries," the company 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."

Asked whether it was considering legal action, a spokesman said: "It is early days but we are considering our position." The company's shares had dropped 18% in early afternoon trade.

In a statement, Virgin Trains welcomed what it described as the transport secretary's "frank announcement" that the contest was flawed.

It said: "We are ready to play a full part in assisting the review to help deliver a franchising system that better serves passengers, taxpayers and the interests of all bidders."

Labour MP Louise Ellman, chairwoman of the Commons Transport Select Committee, described the development as "absolutely astonishing".

She said she would recall the transport secretary and permanent secretary to question them about it.

"This is really a major issue and a major catastrophe for them."

After learning that his firm had lost the bid in August Sir Richard said he was convinced that civil servants had "got their maths wrong."

Justine Greening, who was Transport Secretary at the time, defended what she described as the "robustness of the process".

In August, Labour had also called for a chance for MPs to review the process.

Following the cancellation, shadow transport secretary Maria Eagle said: "The government's belated admission that it ran a flawed tendering process will come as a surprise to no one."