The House of Lords, the country’s highest court, overturned an earlier High Court finding over the investigation into the Al-Yamamah arms deal in 1985, worth 43 billion pounds (54 billion euros, 85 billion dollars).
One senior judge, Lord Thomas Bingham, said it was a "courageous decision" to drop the case by the Serious Fraud Office’s then director Richard Alderman
"It may indeed be doubted whether a responsible decision-maker could, on the facts before the director, have decided otherwise," he added.
The Serious Fraud Office (SFO) was investigating claims that BAE Systems, one of the world’s biggest arms makers, ran a 60-million-pound slush fund for Saudi officials in a bid to attract contracts.
But it ditched its investigation in 2006.
The move was announced by the government’s then chief legal advisor, attorney general Peter Goldsmith.
Then prime minister Tony Blair explained the decision by saying the investigation could threaten intelligence links at a key point in the "war on terror".
The decision to shelve the probe was strongly criticised by anti-corruption campaigners and the British press, which accused the government of bowing to pressure from Riyadh.
The campaigners staged a legal challenge against the decision at London’s High Court, which in April ruled that the SFO had been wrong to ditch its campaign in a strongly-worded judgement.
The court said in April the Saudi threat over intelligence links was a "successful attempt by a foreign government to pervert the course of justice in the United Kingdom".
Judges Alan Moses and Jeremy Sullivan added that the SFO and the government had made an "abject surrender" to "blatant thr
But now the House of Lords has overturned that finding, with top judge Bingham saying that the SFO had decided the public interest in potentially saving British lives outweighed the public interest in pursuing BAE.
The SFO’s lawyer Jonathan Sumption had argued that its decision to drop the probe was "legal and appropriate" and that the High Court had relied on "limited information" in making its ruling.
He also criticised it for highlighting allegations that Prince Bandar bin Sultan, head of Saudi Arabia’s National Security Council, threatened to drop a contract for Eurofighter aircraft before the probe was stopped.
Saudi Arabia has said it considers the affair an internal British matter.
BAE Systems said in a statement following the ruling: "The case heard was between two campaign groups and the director of the SFO.
"It concerned the legality of a decision made by the director of the SFO. BAE Systems played no part in that decision."
The ruling was criticised by the Campaign Against Arms Trade, one of the activist groups which brought the original legal action.
"In the judgment they have handed down, the law lords have failed to answer most of the points we raised or that the High Court raised when it ruled in our favour," spokesman Symon Hill said outside the House of Lords afterwards.
"We feel we may have lost legally but we’ve certainly won politically. Throughout the last few months and the last couple of years, we have been overwhelmed by support by people in all walks of life."
Britain and Saudi Arabia have close ties and last year signed a 4.43-billion-pound deal to supply 72 Eurofighter planes to Riyadh in one of London’s largest ever export orders.