Mr Cook hailed the voluntary agreement with his counterparts in the EU as a "ground breaking" deal to limit the supply of weapons to repressive regimes, but the code was diluted in last-minute talks to meet French objections.
Hubert Vedrine, the French Foreign Minister, who fought against openness in the arms trade, which might harm France's lucrative armaments industry, said the agreement was "useful and realistic".
Human rights groups fear the code will be meaningless. It is intended to make arms sales more open to ensure "peer pressure" discourages EU governments from grabbing military contracts refused by other member states acting on ethical grounds, or from fears that the arms would be used for repression. Governments are committed to assessing all export licensing decisions in the light of human rights and to refuse them if there is "a clear risk" that the material will be used for repression. The code sets out a mechanism for all states to consult each other.
EU states account for about 40 per cent of the world's arms exports, so stricter curbs should in theory have a significant impact. But the code's strength will rest largely on moral pressure to refrain from supplying without consultation.
The risk of loopholes ishuge. A government wanting to supply arms to a regime turned down by another EU government, does not have to make a declaration of intent. It is merely expected to inform the state which refused the licence. This duty to consult only comes into play if the contract is identical to the one refused by the first member state.
David Andrews, the Irish Foreign Minister, who wanted a tougher code, criticised the text. "We wanted a total ban on exporting arms to regimes with an identifiable record of human rights abuses. Africa is littered with them,'' he said. Ireland considered blocking the code but relented, saying a weak code was better than nothing.
Mr Cook said the code "was not toothless. This represents a big step forward.''
Saferworld, an organisation campaigning for a code of conduct on arms exports, welcomed the agreement, but said: "The key now is that it is implemented rigorously and is continually strengthened." Oxfam called for full public disclosure of all arms transactions.