Lord Goldsmith also told peers that Prime Minister Tony Blair had agreed that the continuation of the investigation would cause "serious damage" to relations between the UK and Saudi Arabia.

The probe had related to the Al Yamamah arms deal with Saudi Arabia. BAE has denied any wrongdoing.

Job fears

It emerged earlier this month that French and Saudi officials were in talks over a possible alternative deal, which could scupper the BAE sale.

The Saudi government was reported to have been angered by the SFO investigation into allegations of a slush fund for members of the country's royal family.

Lord Goldsmith said that both Mr Blair and Defence Secretary Des Browne had argued that carrying on the investigation would harm intelligence and diplomatic co-operation with Saudi Arabia, in turn damaging the UK's national security.

No one is going to win any Saudi business until this SFO investigation ends

Responding to the announcement, BAE Systems said: "After over two years of what has been a thorough investigation by the SFO, we welcome the statement made today by the Attorney General in the House of Lords."

BBC business editor Robert Peston says that major UK companies - both arms firms and other manufacturers - have voiced fears that they stood to lose other lucrative deals should the probe have continued.

The SFO said its decision had been taken "following representations that have been made both to the Attorney General and the Director of the SFO concerning the need to safeguard national and international security".

It added: "No weight has been given to commercial interests or to the national economic interest."

The Al Yamamah contract with Saudi Arabia is thought to have been worth £40bn to BAE Systems over the past two decades.

Saudi Arabia said in August that it planned to buy 72 Eurofighters to replace its range of Tornado jets, which were also made by BAE.

Liberal Democrat constitutional affairs spokesman Simon Hughes said: "From the moment investigations began, it was clear that they would not be popular in Saudi Arabia.

"But to pull the plug halfway through, and when real progress was just being made, is the worst of all possible outcomes.

"It is not in the interests of a successful British defence industry, of British exports, or of British diplomatic interests around the world that we cannot now show that our legal system is above undue influence or improper pressure."

But Shadow Defence Secretary Liam Fox said: "We made it clear that because of the commercial issues involved we wanted the SFO to make a rapid decision about whether to continue their inquiry or whether to bring it to an end.

"Having decided there is no case to answer, it will be welcomed by all those concerned."