A consultation that led to the proposed closure of a paediatric heart unit at a west London hospital was lawful, the Court of Appeal has ruled.
The Royal Brompton Hospital had challenged the way the consultation was carried out by the Joint Committee of Primary Care Trusts (JCPCT).
The JCPCT will make its final decision on the paediatric cardiac surgical unit in Chelsea in July.
The hospital maintains its services will be "harmed" if the unit is closed.
The JCPCT's move is part of a national review aimed at streamlining and moving paediatric congenital cardiac surgery services (PCCS) to fewer sites across England.
Its consultation document said keeping two of the three specialist units in London - the Evelina Hospital, a part of Guy's and St Thomas' Hospital Trust, and Great Ormond Street - was the "preferred option". The Royal Brompton in Chelsea is the third centre.
'Biggest NHS consultation'
In November, Mr Justice Owen at the High Court said the JCPCT's consultation was "distorted" as it had failed to assess fairly the quality of the hospital's research and innovation. But that ruling was overturned by the Court of Appeal.
Three appeal judges, Lady Justice Arden, Lord Justice Richards and Sir Stephen Sedley, said "the consultation process cannot be said to be unfair".
The judges praised the "excellence" of the hospital and added: "A member of the public might well find it difficult to understand why a centre of the standard of the Royal Brompton should cease to be a centre for paediatric cardiac surgical services under the configuration exercise."
A statement from the Royal Brompton Hospital said: "We look forward to the decision-making body, the Joint Committee of Primary Care Trusts, considering all relevant information when coming to a decision about the future of children's heart surgery in England, which we understand will not be taken before July.
"The trust took this legal action on behalf of patients and their families. It was action of the last resort and taken with a heavy heart, after a number of attempts to settle the matter at an earlier stage failed.
"We remain convinced that our highly respected services for patients in England and Wales will be harmed if our unit is dismantled as a consequence of the Safe and Sustainable process to date."
The JCPCT chairman Sir Neil McKay said the option for three surgical centres option for London, which could include the Royal Brompton, was not ruled out.
He added: "We can now take into account the evidence submitted to us by the many thousands of people and organisations in what was the biggest public consultation ever undertaken by the NHS. It is only right all of these voices can be heard."
The JCPCT would also take account of "the respondents who called for us to give further consideration to options with three surgical units in London", he said.
And it would consider several new proposed options that include "the surgical centres in Leeds, Leicester and Southampton amongst others".
The final decision will be made on 4 July.
Sir Neil said the accusations made against the JCPCT by the Royal Brompton Hospital were "hurtful" and "personally distressing" to doctors who had connections with Great Ormond Street and the Evelina Children's Hospital, and had advised the JCPCT.
During the court hearing, the barrister for the JCPCT said the hospital was "short-circuiting" proceedings and "putting a spanner in the works" with its legal bid before a decision had been made.
But the hospital argued that the closure would be "bureaucratic vandalism" and that delaying legal challenges could distort the consultation process.
The the legal battle between the two NHS bodies has cost the Royal Brompton Hospital about £1.2m. The hospital said it had "tried hard to avoid the legal route", but it was necessary "to fight to protect the needs of patients".
Professor Sir Roger Boyle, former national director for heart disease and stroke, said: "It is novel for one part of the NHS to take another part to court at such a huge cost.
"We know the cost to Brompton will be in the region of £1.2m, plus interest, which need not have been spent."
The Children's Heart Federation charity said it was "horrified" by the bill and urged other hospitals not "to waste this level of money on further legal action".
Campaigners 'very angry'
The national review by the JCPCT came after a report, following an inquiry in Bristol between 1990 and 1995.
It recommended that paediatric cardiac units should perform at least 300 operations a year and that such surgery be done in a few specialist centres. Several children's heart units in hospitals outside London are also affected.
Campaigners fighting to save the unit in Glenfield Hospital in Leicester said they were relieved a final decision would be made soon.
John Rigby, a member of the campaign group, said: "I'm very relieved personally that the decision has gone this way.
"But I'm also very angry with the Royal Brompton that they have taken this step and it's been allowed to drag on."
Elizabeth Aryeetey, lead nurse for the East Midlands Congenital Heart Centre at Leicester's Hospitals, said: "We are relieved the review process can now continue and, before too long, bring to a close what has been an unsettling time for our patients and their families."