The case was brought by local authorities, Greenpeace, Friends Of The Earth and rival extended runway scheme Heathrow Hub.
They argued that the government’s National Policy Statement, setting out its support for the project, failed to account fully for the impact on air quality, climate change, noise and congestion.
Transport secretary Chris Grayling said: “The positive outcome confirms my belief that government undertook a robust process in coming to its decision to support a new north-west runway at Heathrow Airport by 2030.
“This was one of the largest public law challenges of all time and I am pleased that the hard work of the independent Airports Commission and the department has been shown in good light.”
A Heathrow spokesperson said: “We are delighted with today’s ruling which is a further demonstration that the debate on Heathrow expansion has been had and won, not only in Parliament, but in the courts also.
“We are getting on with delivering the once-in-a-generation project that will connect Britain to global growth, providing thousands of new jobs and an economic boost for this country and its future generations.”
Heathrow plans is to begin construction in 2021, with the third runway operational by 2026.