The political arguments about a third runway for London's Heathrow airport broke out again fiercely last night after a High Court judge declined to quash the project but told the Government to get its aviation policy in order.

Gordon Brown and David Cameron made uncompromising pledges, the former to continue the highly controversial project, the latter to scrap it, after a legal judgment which left ministers and a powerful band of opponents of the third runway scheme both claiming victory. Heathrow expansion is the green issue on which there is the clearest divide between the parties in the run-up to the coming election, with the Government claiming the expansion is necessary for Britain's economic future.

Environmental campaigners, on the other hand, say the extra aircraft carbon emissions it will generate will make it impossible for Britain to meet its future climate change targets – as do the Conservatives – while local councils in west London are strongly against it on the grounds of increased noise and pollution.

Six local authorities and four environmental groups, including Greenpeace and the Campaign to Protect Rural England, have mounted a judicial challenge to the decision to go ahead with third runway, announced by the then Transport Secretary, Geoff Hoon, in January last year.

Giving judgment in the case yesterday, Lord Justice Carnwath stopped short of ruling out the project. But he made a string of criticisms of the Government's position on airport expansion in general and the Heathrow expansion plan in particular – on CO2 emissions, transport links and costings – which led the opponents to claim that, in practice, the scheme was unlikely to go ahead.

However, the Transport Secretary, Lord Adonis, claimed that the ruling changed nothing whatsoever, and later, Mr Brown went out of his way to insist that Runway 3 was the right decision. "It is entirely compatible with our carbon reduction targets, as demonstrated by the recent report by the independent committee on climate change," he told a press conference in Brussels. He said the Government had backed an extra runway "only after a detailed assessment showing that the strict environmental limits for expansion could be met".

He added: "We have always made clear that normal planning process would still need to be followed before a runway could be built. We are taking seriously both the concerns that people have and the need for public consultation. But we took a tough decision, the right decision necessary for the future of Britain and the economy, and a new runway will help secure Britain's economic future."

Mr Cameron took the opposite tack entirely and put down a political marker for those who think he might backtrack, if in office, on the Tory pledge to scrap Runway 3, which has been important for the Conservative Party's green credentials and for its "rebranding", but not popular with some sections of the party. He told The Independent: "I have made it very clear time and again that under a Conservative government the third runway is not going ahead: no ifs, no buts."

The judge's complex, 12,000-word judgment yesterday led to the somewhat bizarre spectacle of both sides in the case claiming it meant completely different things.

Speaking on behalf of the local councils, Councillor Ray Puddifoot said that it was "a spectacular victory for our residents". He said: "If after this ministers are still intent on pressing ahead with expansion they will have to go back to the beginning and justify the whole economic case in public."

Greenpeace's executive director John Sauven said: "This ruling leaves the Government's Heathrow decision in tatters. Ministers will now have to go back to the drawing board and conduct a broad consultation on key issues where their case is extremely weak."

Yet a Department for Transport (DfT) spokesman said that the judgment made no difference. "It is completely untrue to suggest the court ruling today means the Government has to re-run the consultation on Heathrow," he said. "Today's judgment in fact upholds our policy and refused to quash our decisions – it changes nothing."

Close reading of the judgment shows that what Lord Justice Carnwath did do was to order the Government to align its climate change policy with its airport expansion policy – two policies, in fact, which green campaigners say are pointing in opposite directions. It must do this, the judge said, by making sure that the next National Policy Statement on airports, due in 2011, takes account of the Climate Change Act 2008, under which Britain's legally binding national targets for cutting CO2 emissions are laid down.

However the DfT said that that was going to happen anyway and it would have no bearing on the Heathrow expansion decision.

But the legal fight is not over yet, as the judge said that both sides could come back to him at a later date with further arguments.

World's busiest airport: A brief history

*1946 Became a civil airport, using tents as a terminal. In the first year 63,000 passengers flew to 18 destinations.

*1951 Annual passenger numbers rose to 796,000.

*1952 Designated London's airport, taking over from Croydon Airport.

*1953 Construction began on the first modern runway. Until then it had three shorter runways designed for piston rather than jet aircraft.

*1955 The first permanent building – Terminal 2 – opened.

*1961 Terminal 3 opened to handle long-haul flights.

*1968 Terminal 1 opened. Fourteen million passengers now using Heathrow annually.

*1980 Passenger numbers rose to 27 million a year.

*1986 Terminal 4 opened.

*2008 Terminal 5 opened.

*2009 65.9 million passengers. Government approved third runway.