The Court of Appeal ruled today that Health Secretary Jeremy Hunt did not have the power to implement cuts at Lewisham Hospital in south east London.
Three judges announced their decision on the second day of a hearing in London.
Supporters of the highly-regarded hospital cheered when Lord Dyson, the Master of the Rolls, sitting with Lord Justice Sullivan and Lord Justice Underhill, gave their decision in an appeal brought by the Government over a High Court judge's ruling in July.
Mr Justice Silber had then ruled that Mr Hunt's move to downgrade A&E and maternity services was "unlawful".
Rosa Curling from law firm Leigh Day, who represented the Save Lewisham Hospital Group said: "We are absolutely delighted with the Court of Appeal's decision today. It confirms what the Save Lewisham Hospital Campaign has been arguing from the start - that the Secretary of State did not have the legal power to close and downgrade services at Lewisham Hospital.
"This expensive waste of time for the Government should serve as a wake up call that they cannot ride roughshod over the needs of the people.
TODAY'S TOP STORIES
"The decision to dismiss the appeal also reaffirms the need for judicial review, a legal process by which the unlawful decisions of public bodies, including the Government, can be challenged by the public.
"The Government's current consultation on the judicial review process is in direct response to these types of cases where it has acted unlawfully but does not want to be challenged by those who put them in power."
Quashing Mr Hunt's decision in July, Mr Justice Silber declared that he had breached provisions of the National Health Services Act 2006.
The ruling was a serious blow for Mr Hunt because the case involved the first legal testing of a new Government procedure for dealing with failing NHS organisations - referred to as the Unsustainable Providers Regime.
Under the new regime, Mr Hunt had appointed a Trust Special Administrator (TSA) to the "very badly performing" South London Healthcare Trust, which went into administration after it started losing more than £1 million a week.
To help deal with the problem, the special administrator recommended measures including cuts at Lewisham Hospital. Mr Hunt told Parliament in January that A&E and maternity services at the hospital would be downgraded.
Mr Hunt assured MPs the changes would improve patient care in south London, saving up to 100 lives a year, but gave an undertaking not to implement them pending the legal challenge.
At the Court of Appeal yesterday Rory Phillips QC, for the Health Secretary and the Trust Special Administrator, argued that they had not acted outside their powers.
He challenged Mr Justice Silber's findings that the TSA was not entitled to recommend the changes to the services at Lewisham and that Mr Hunt was not entitled to decide to implement them.
Referring to the 2006 Act, he said that its "wording, statutory context and purpose" should have led Mr Justice Silber "to conclude that they were entitled so to act, consistently with Parliament's evident intention".
July's ruling was won by Lewisham Council and the campaign, an umbrella group supported by patients, community groups, GPs, hospital doctors, nurses and other health professionals.