British arms sales to Saudi Arabia have been ruled unlawful by the court of appeal in a critical judgment that also accused ministers of ignoring whether airstrikes that killed civilians in Yemen broke humanitarian law.

Three judges said that a decision made in secret in 2016 had led them to decide that Boris Johnson, Jeremy Hunt and Liam Fox and other key ministers had illegally signed off on arms exports without properly assessing the risk to civilians.

Sir Terence Etherton, the master of the rolls, said on Tuesday that ministers had “made no concluded assessments of whether the Saudi-led coalition had committed violations of international humanitarian law in the past, during the Yemen conflict, and made no attempt to do so”.

As a result, the court said that the UK export licensing process was “wrong in law in one significant respect” and ordered Fox, the international trade secretary, to hold an immediate review of at least £4.7bn worth of arms deals with Saudi Arabia.

Campaign Against Arms Trade (CAAT), which brought the case against Fox, welcomed the verdict that continuing to license military equipment for export to the Gulf state was unlawful.

Thousands of civilians have been killed since the civil war in Yemen began in March 2015 with indiscriminate bombing by a Saudi-led coalition that is supplied by the west and accused of being responsible for about two-thirds of the 11,700 killed in direct attacks.

A critical passage in the ruling added that “a close reading” of evidence supplied in secret suggested that in “early 2016” – probably when David Cameron was prime minister – that there had been a covert change of UK policy towards Saudi Arabia.

“There was a decision, or a change of position, so that there would be no assessment of past violation of IHL [international humanitarian law]” by Saudi Arabia in Yemen, Etherton, Lord Justice Irwin and Lord Justice Singh concluded.

Dr Anna Stavrianakis, a senior lecturer in international relations at the University of Sussex, said the verdict demonstrated that ministers had “turned a blind eye” to events in Yemen. “This finally bring some accountability to the UK’s role in the war,” she added.

Fox responded by suspending new arms sales to Saudi Arabia while promising to appeal against the verdict. Labour called for an full inquiry and the permanent end of all arms sales to Riyadh.

The international trade secretary made an emergency statement to MPs in which he argued that the court had not determined whether it was ethical to sell arms to Saudi Arabia, but “concerns the rationality of the process used to reach decisions”.

Fox added: “While we do this, we will not grant any new licences for export to Saudi Arabia and its coalition partners which might be used in the conflict in Yemen.”

Later, Fox was understood to have privately told at least one MP that he expected that the review process called for by the court would take about 10 weeks – and would not lead to any of the previous licensing decisions being overturned.

Arms trade campaigners say that Paveway, Brimstone and Storm Shadow bombs of the type used by the Saudi air force in Yemen are covered by separate “open licences”, which have not been suspended by Fox, and are only under review. “The bombs will continue,” one source added.

Arms export licensing decisions of the type held to be unlawful are made by Fox, as international trade secretary, on the advice of the foreign secretary, an office currently held by Hunt and previously by Johnson.

Earlier this month it emerged that Johnson had recommended that the UK allow Saudi Arabia to buy bomb parts expected to be deployed in Yemen, days after an airstrike on a potato factory in the country had killed 14 people in 2016.

Labour called for a full parliamentary or public inquiry into arms sales to the Gulf kingdom. The party’s leader, Jeremy Corbyn, said: “UK advice, assistance and arms supplies to Saudi’s war in Yemen is a moral stain on our country. Arms sales to Saudi must stop now.”

Lloyd Russell-Moyle, a Labour backbench MP who was in court for the ruling, blamed past and present British foreign secretaries and other ministers for ignoring the evidence of civilian casualties. Focusing on Johnson, the Tory leadership frontrunner, Russell-Moyle added: “This goes right to the top of the Tory party.”

The UK has licensed the sale of at least £4.7bn worth of arms to Saudi Arabia since the start of the civil war in Yemen, with most of the recorded sales taking place before 2018.

Both Johnson and Hunt have defended the UK’s arms relationship with Riyadh, although other European countries have halted sales. Germany said it would no longer supply arms following the murder of the journalist Jamal Khashoggi by Saudi agents in Istanbul last autumn.

Andrew Smith of CAAT called on ministers to halt the arms sales immediately: “It should never have taken a court case brought by campaigners to force the government to follow its own rules.”

The verdict was welcomed by Yemenis in Sanaʽa, the Houthi-controlled capital of the country, where heavy bombing by the coalition over the last four years has hit hundreds of civilian targets.

“I will be very glad if this ruling makes a difference. Selling weapons to Saudi Arabia is a contribution to killing Yemeni people so we feel grateful to the British judges who considered this,” said Ahmed al-Hatami, a student at Sana’a University.

The Saudi foreign minister, Adel al-Jubeir, on a trip to London, argued ahead of a bilateral meeting with Hunt that arms sales must continue: “The only people that will benefit from the ending of arms sales to Saudi Arabia will be ‘the death to America’ crowd.”