The Government is to pay out more than £220 million to a US defence firm after a tribunal found it had unlawfully terminated a contract to provide the controversial eBorders programme.
An Arbitration Tribunal awarded Raytheon Systems Limited £49.98 million in damages after it found the processes the now-defunct UK Border Agency used when reaching a decision to scrap the agreement were flawed, a letter from the Home Secretary to Keith Vaz MP reveals.
In addition, the Home Office must pay Raytheon £9.6 million for disputed contract change notices, £126 million for assets acquired through the contract between 2007 and 2010 and £38 million in interest.
eBorders, devised by the Labour government in 2003, was designed to count everyone in and out of the UK by collecting advance passenger information on all scheduled inbound and outbound journeys to and from the UK.
In her letter to Mr Vaz, Theresa May said: "The Treasury will work with the Home Office to make sure these costs are met without any impact on frontline services.
"We are looking carefully at the tribunal's detailed conclusions to see if there are any grounds for challenging the award.
"The Government stands by the decision to end the eBorders contract with Raytheon. This decision was, and remains, the most appropriate action to address the well-documented issues with the delivery and management of the programme."
The Home Secretary said key milestones had been missed by Raytheon in 2010 and parts of the programme were running at least a year late.
"The situation the Government inherited was, therefore, a mess with no attractive options," she said. "All other alternatives available to the Government would have led to greater costs than the result of this tribunal ruling."
Home Office permanent secretary Mark Sedwill has asked the National Audit Office to conduct a full review of eBorders from its inception, she added.
Earlier this year, head of the UK Border Force Sir Charles Montgomery told MPs the troubled scheme had been "terminated" in its current form.
Delays, brief changes and the Raytheon legal battle are among some of the problems to dog the eBorders programme.
Mrs May added that since 2010 the Government has adopted a policy of separating and breaking down larger, longer-term contracts worth more than £100 million.
And the original eBorders requirement - to record advanced passenger information for checking against terrorist and crime watchlists - is being delivered, the Home Secretary said.
In a statement to the New York Stock Exchange, Raytheon, which recorded 2013 sales of 24 billion US dollars (£14.3 billion) and employs 63,000 worldwide, said: "The tribunal's ruling confirms that (Raytheon) delivered substantial capabilities to the UK Home Office under the eBorders programme.
"Raytheon remains committed to partnering with the UK Government on key defence, national security and commercial pursuits."
Jonathan Isaby, chief executive of the Taxpayers' Alliance, said: " Taxpayers will be furious that the cost of yet another large Government project has spiralled out of control.
"Ending contracts early is sometimes the only course of action but that's no excuse for the size of the damages payout, and the poor performance of the scheme in the first place is a cause for real concern.
"The dire state of the public finances means that it's more important than ever to ensure value for money is achieved on large projects."
David Hanson, shadow Home Office Minister, said: "This is a crushing verdict on a Home Office decision made by David Cameron's government, which has cost the taxpayer hundreds of millions of pounds over the last four years.
"Theresa May must now make clear what legal advice she took before taking a decision that has cost the taxpayer £224 million. She must also set out how much the taxpayer has had to pay out to foot the bill for the Home Office's legal fees.
"The Home Secretary needs to make clear when the e-borders programme will be back on track. As a result of this stalled process, we are still far away from counting people in and out of the UK."
Mr Vaz, chair of the Home Affairs Select Committee, said his committee would want to hear more from Lin Homer, the then head of the UKBA, who is now chief of HM Revenue and Customs.
He said: " This is a catastrophic result. Minister after minister and successive heads of the UKBA told the Select Committee that the Government was the innocent party and that Raytheon had failed to deliver.
"We have pursued this issue for five years and Raytheon informed us that the UKBA had given them no benchmarks against which they were to perform.
"It is now clear that the UKBA didn't know what they wanted from the eBorders programme.
"We will want to hear further from Lin Homer, the then head of the UKBA, as to why she sanctioned such a defective agreement.
"It is important that those who have responsibility should be held to account for failing the taxpayer in such a costly way.
"When Parliament returns, we intend to hear from Raytheon, something we have been prevented from doing because of the arbitration, so that we can understand just what went wrong and ensure that procurement of this kind never happens again."