UK government arms sales to Saudi Arabia are lawful, the High Court has ruled, after seeing secret evidence.
The court rejected claims the government was acting illegally by not suspending weapon sales to the kingdom, which is fighting a war in Yemen.
The UN claims Saudi air strikes against Houthi rebels in that country have caused thousands of civilian deaths.
The Campaign Against the Arms Trade, which brought the case, said it would appeal against the ruling.
The group had claimed the UK has contravened humanitarian law and attacked the refusal of the Secretary of State for International Trade to suspend export licences for the sale or transfer of arms and military equipment.
But Lord Justice Burnett and Mr Justice Haddon-Cave, sitting in London, said the decision to carry on the arms trade was not unlawful.
The judges said that “closed material”, which had not been made public for national security reasons, “provides valuable additional support for the conclusion that the decisions taken by the secretary of state not to suspend or cancel arms sales to Saudi Arabia were rational”.
Equipment sold to Saudi Arabia includes Typhoon and Tornado fighter jets, as well as precision-guided bombs.
The sales contribute to thousands of engineering jobs in the UK, and have provided billions of pounds of revenue for the British arms trade.
Saudi Arabia has been supporting Yemen’s internationally-recognised government after a civil war broke out in 2015.
Houthi rebels, loyal to deposed president Ali Abdullah Saleh, began an attack in 2014, forcing leader Abdrabbuh Mansour Hadi to flee the country for a time.
Since then the Saudi kingdom, and eight other mostly Sunni Arab states, have supported an air campaign aimed at restoring Mr Hadi’s government.
Andrew Smith, of Campaign Against Arms Trade, said: “This is a very disappointing verdict, and we are pursuing an appeal.
“If this verdict is upheld then it will be seen as a green light for government to continue arming and supporting brutal dictatorships and human rights abusers like Saudi Arabia that have shown a blatant disregard for international humanitarian law.
“Every day we are hearing new and horrifying stories about the humanitarian crisis that has been inflicted on the people of Yemen.”
Rosa Curling, of law firm Leigh Day, which represented the campaign group, said: “Nothing in the open evidence, presented by the UK government to the court, suggests this risk does not exist in relation to arms to Saudi Arabia.
“Indeed, all the evidence we have seen from Yemen suggests the opposite: the risk is very real. You need only look at the devastating reality of the situation there.”