A judge rejected nine out of ten grounds of challenge brought in five cases by objectors to the multibillion-pound project.
But Mr Justice Ouseley, sitting at London’s High Court, allowed the tenth challenge and declared consultations on compensation for the owners of properties blighted by the scheme was “so unfair as to be unlawful”.
The Government immediately said that the consultation exercise would be re-run and insisted that the setback would not delay the project.
Rail Minister Simon Burns said: “This is a major landmark victory for HS2 and the future of Britain.
“The judge has categorically given the green light for the Government to press ahead without delay in building a high-speed railway from London to Birmingham, Manchester and Leeds.”
But the legal battle is not yet over and will now shift to the Court of Appeal.
The re-run property consultations could mean people getting more compensation, and pay-outs could rise.
Some 172,000 properties within 0.6 miles (1km) of the first phase are alleged to be affected by “HS2 blight”.
The Government has already said that compensation will be “generous” and the Department for Transport (DfT) said that pledge still stood.
The compensation ruling was a victory for the High Speed 2 Action Alliance (HS2AA), consisting of more than 70 affiliated action groups and residents’ associations.
Richard Stein, from law firm Leigh Day, which represented HS2AA, said: “This was never a Nimby argument. Many thousands of people living along the route will not be able to sell their homes for some 15 years because their homes are blighted.
“They should not have to bear the burden for this national project.”
Hilary Wharf, director of HS2AA, described the ruling as “a huge victory” and said: “The Government’s shabby attempt to railroad through an inadequate compensation scheme whilst ignoring the views of ordinary people has been judged to be unlawful.
“The Government must now go back to the drawing board and rethink its approach to compensation.
“There are many better compensation alternatives which would help all those up and down the country trapped by HS2.”
Shadow transport secretary Maria Eagle said: “Britain’s railways face a major capacity challenge in the years to come, which is why the previous Labour government first proposed HS2 to ease the pressures on our existing network.
“It is right that this vital infrastructure project can now proceed once ministers have re-run the part of the consultation that they botched.”
She added: “We’ve now had nearly three years of dither and delay over HS2 which must now come to an end.
“It is vital that the Government now gets on with introducing the necessary legislation to make this scheme a reality on the ground. When they do so, they will have cross-party support from Labour.”
The five cases were brought by various bodies, including 18 local councils, scores of residents’ associations and action groups, plus farmers and a golf club.
The nine out of 10 challenges which were rejected included attacks on the manner in which the project has been steered through Parliament and alleged breaches of EU environmental and habitat directives.
They also included allegations that the Government failed to take account of relevant issues and was guilty of indirect discrimination because of the impact of redevelopment of London’s Euston station on the local ethnic minority community.
Many of the action groups are now considering taking their cases to the Court of Appeal in the coming weeks.
Among them is a 15-council coalition, called 51m alliance. Its chairman, Martin Tett, who is also leader of Buckinghamshire County Council, said: “Firstly, we are delighted that the judge agrees with the HS2AA’s challenge that the compensation consultation was fundamentally flawed.
“This decision will have a real impact on the lives of so many people whose homes and lives are currently blighted by this scheme.”
He added that it was “totally bizarre” that his group’s challenge had failed, saying the judgment “defied common sense”.