The government has been accused of "glaring" double standards over a decision to end a fraud probe into an arms deal between Saudi Arabia and BAE.
Lord Goldsmith said the decision came from the Serious Fraud Office
In a Lords debate, Liberal Democrat Baroness Williams said the decision had done "great damage", and weakened the fight against corruption.
Ministers say the probe was dropped in the interests of national security.
But critics claim ministers ignored anti-bribery commitments, to save a threatened £6bn Eurofighter deal.
Baroness Williams said the decision would weaken the battle against corruption in developing countries which "we have been addressing in lofty tones about good governance".
She added that while many defence companies had been working hard to improve their reputation, the decision had been very damaging.
Attorney General Lord Goldsmith has denied reports that Downing Street had pressured him into ending a fraud probe into a BAE deal.
He said the decision to drop the inquiry had be taken by the Serious Fraud Office director.
He told peers the BAE deal had been a "specific instance", with the Saudi authorities threatening to withdraw intelligence co-operation if the investigation went ahead.
If "damage had been done to the country", the question asked of him would have been "Why would you allow this to go on?", Lord Goldsmith said.
He added: "I wouldn't have had an answer."
Lord Goldsmith said: "We don't condone corruption or involvement in corrupt practices anywhere."
Labour's Lord Brennan said: "I cannot imagine any ordinary citizen in this country thinking that it was irrelevant or not vital for a government to consider national security in a situation like this."
BAE has always denied claims that it set up a £60m "slush fund" to secure the al-Yamamah deal in the 1980s.
The government says the investigation was dropped because it threatened national security, by damaging relations with Saudi Arabia - seen as a key strategic ally in the so-called "war on terror".
It has also argued that there were doubts about whether a successful prosecution could be brought, as many of the allegations pre-dated 2001, when an anti-bribery convention was incorporated into British law.
There were fears a Eurofighter deal would be lost
But the decision was announced weeks after reports that the Saudis were threatening to pull out of a deal to buy 72 Eurofighter jets from BAE, threatening thousands of British jobs.
The Lib Dems say the government was effectively blackmailed into dropping the probe by the Saudis.
Dropping a bribery fraud for commercial reasons would be against the rules drawn up by the anti-bribery convention drawn up by the Organisation for Economic Co-operation and Development (OECD).
On Thursday the Guardian reported that Lord Goldsmith had changed his mind about whether there was enough evidence to bring charges against BAE, following pressure from Downing Street.
But in a statement, the attorney general said the decision had come from the Serious Fraud Office, which had concluded that any investigation would jeopardise national security.
Lord Goldsmith also told the Financial Times that, if the investigation had been continued, senior Saudi royals would have been needed as essential witnesses - and he judged that it would be unrealistic to expect them to submit to questioning.