Lord Justice Moses, one of the judges, told the high court in London that Robert Wardle, the director of the SFO, had failed to convince them that he had done his utmost to secure the rule of law.
"No one, whether within this country or outside, is entitled to interfere with the course of our justice," Moses said.
"It is the failure of government and the defendant to bear that essential principle in mind that justifies the intervention of this court."
Tony Blair, then prime minister of Britain, was criticised by political opponents and the media for saying that British national security would suffer should an SFO investigation into Al Yamamah proceed.
Speaking to Al Jazeera, David Howarth, a British member of parliament who has been pressuring sucessive UK governments for greater transparency, said one of the real reasons behind Blair's position was commercial.
Howarth said: "There was a threat from the Saudi's to pull out from the typhoon deal and to make things more difficult with arms deals.
"The whole episode has had a bad effect on Britain's international reputation, but the court's decision is part of restoring that reputation."
In 1995, Britain and Saudi Arabia struck an agreement, worth an estimated $16m to BAE Systems, to equip Saudi Arabia's armed forces with Typhoon combat aircraft.
The deal was part of a wider cooperation between the two countries covering several areas, including national security.