BAE sold Tornado and Hawk jets to Saudi Arabia under the deal
Former Attorney General Lord Goldsmith has defended the decision to scrap the corruption probe into a £43bn BAE arms deal with Saudi Arabia.
The High Court has said the decision by the Serious Fraud Office was unlawful.
But Lord Goldsmith said it was right because the inquiry might have jeopardised national security.
BAE maintains it acted lawfully and the SFO is now considering whether or not to re-open its investigation into the al-Yamamah controversy.
It originally launched a probe into the deal with Saudi Arabia in 1985, which provided Tornado and Hawk jets plus other military equipment.
Tony Blair said that the Saudis had privately threatened to cut intelligence co-operation with Britain unless the inquiry was stopped.
Lord Goldsmith announced in December 2006 that the investigation into the arms company was to be discontinued but it was SFO Director Robert Wardle who took the decision.
Lord Goldsmith said he hoped the SFO would appeal
The peer told Sky News he did not regret the decision: "It was of course uncomfortable... but I believe it was the right decision to take, in the public interest, in order to prevent terrorism."
He said he had been convinced the case was "doomed to failure" and not worth pursuing further given the risks.
"The consequence would have been that we would have waited for 18 months, all this damage to the country, all this damage in relation to terrorism could have taken place and at the end of the day we would have said 'terribly sorry, but we're not going to proceed with this case in any event'.
"It would have been a dereliction of duty to have taken that view and it would have been absolutely no comfort to people who, heaven forbid, had been injured or lost loved ones in a terrorist attack to say 'we're terribly sorry but we thought we ought to wait 18 months to see if this case could go ahead'."
The High Court judgement found that Mr Wardle had failed to satisfy the court that all that could reasonably be done had been to resist the threats.
But Lord Goldsmith criticised that approach.
"The final core decision of the court, as I read it, I fear is rather unrealistic because what they say is that instead of concentrating on the effects of what they say was a threat, what Robert Wardle ought to have done was to consider how that threat could be resisted.
"I'm afraid that in the real world, the risks to national security, the risks from a withdrawal of Saudi Arabian co-operation in relation to intelligence and terrorism prevention, would have been very, very serious and that's what all the experts said and that's the reality he had to face."
He said he hoped the Serious Fraud Office would appeal against the decision.
But Liberal Democrat leader Nick Clegg called for the inquiry to be reopened.
He said: "I want it restarted because we cannot allow the precedent to be set that blackmail by other powers or individuals should stop the course of justice."
But he said he was opposed to government proposals to give the attorney general specific powers to intervene in future.
"The present situation where the SFO can do so is certainly something which should not be altered in the way the government now proposes.
"I am very uncomfortable with the scope of that power at the moment and I don't want to see it widened," he said.
Shadow chancellor George Osborne said they would back the new powers - but only with increased safeguards.
"We believe there are circumstances where the attorney general should be able to stop a prosecution in the interests of national security," he said.
"But importantly, and this is a distinction as I understand it with what the government is proposing in new legislation, we think that decision should be subject to judicial scrutiny.
"Yes, give the attorney general the power but make sure that decision can be scrutinised by the judges."