Health Secretary Jeremy Hunt has had his decision to reduce services at a major hospital declared unlawful and quashed by the High Court.
Mr Justice Silber ruled Mr Hunt acted outside his powers when he announced casualty and maternity units at Lewisham Hospital would be downgraded.
He said the Secretary of State had breached provisions of the National Health Services Act 2006.
The judge gave him permission to appeal against the decision.
Mr Justice Silber said recommendations of the Secretary of State had to have regard to, or be supported by, GP commissioners.
It was quite clear that the Lewisham GP commissioners did not give support to the proposals, said the judge.
He went on: "On the contrary, they strongly opposed them although those GP commissioners in a number of surrounding but different areas were happy with them.
"I considered that it was the absence of support from the local GP commissioners which constituted an additional reason why the decision of the Secretary of State cannot stand."
The challenge was brought by Save Lewisham Hospital and the London Borough of Lewisham.
Dr Louise Irvine, a local GP who chairs the Save Lewisham Hospital campaign, said: "This is an incredible day.
"We are delighted for every single person who has supported the campaign and those who will now continue to benefit from this extraordinary hospital."
Rosa Curling, a lawyer with solicitors' firm Leigh Day acting for the campaigners, described it as a "tremendous victory".
She said: "This judgment should serve as a warning to the government that, if they try to do this, local communities will fight back to ensure their healthcare services remain in place."
Mayor of Labour-run Lewisham Council, Sir Steve Bullock, said justice had been delivered to a hospital "well-managed, highly-respected and financially solvent".
In January Mr Hunt told MPs that the cuts were necessary because neighbouring South London Healthcare NHS Trust has been losing more than £1m every week.
A spokesman said Mr Hunt's department was "disappointed by the decision" and would consider the judgment carefully.
He said: "This judgment applies to one aspect of a package of changes which we believe are in the best long-term interests of patients and the public across south-east London.
"We expect to continue other elements of that package of changes, including the dissolution of the South London Healthcare NHS Trust, planned for October 1 - although there are a number of steps to go before that can take place."
The other changes expected to go ahead are King's Health Partners taking over Princess Royal Hospital and the merger of Queen Elizabeth Hospital and Lewisham Hospital trusts.