Campaigners have won a legal challenge over the UK government's decision to allow arms sales to Saudi Arabia, which is engaged in the war in Yemen.
Campaign Against Arms Trade argued the decision to continue to license military equipment for export to the Gulf state was unlawful.
It said there was a clear risk the arms might be used in a serious violation of international humanitarian law.
Judges said licences should be reviewed but would not be immediately suspended.
International Trade Secretary Liam Fox said the government would not grant any new licences for export to Saudi Arabia and its coalition partners while it considers the implications of the judgment.
A spokeswoman for Prime Minister Theresa May said the government was "disappointed" and would be seeking permission to appeal against the judgment.
Under UK export policy, military equipment licences should not be granted if there is a "clear risk" that weapons might be used in a "serious violation of international humanitarian law".
Giving judgment at the Court of Appeal in London, Master of the Rolls Sir Terence Etherton said the government "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".
He said the government "must reconsider the matter" and estimate any future risks.
Mr Fox said the government always took its export obligations very seriously.
"Today's judgment is not about whether the government has made the right or wrong decisions about granting export licences, but concerns the rationality of the process used to reach decisions," he added.
'Preventing further bloodshed'
The UK has licensed more than £4.7bn of arms exports to the Saudis since the bombing of Yemen began in March 2015.
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.
Campaign Against Arms Trade spokesman Andrew Smith welcomed the judgment, saying the Saudi Arabian regime was one of the most brutal and repressive in the world - yet for decades had been the largest buyer of UK-made arms.
"No matter what atrocities it has inflicted, the Saudi regime has been able to count on the uncritical political and military support of the UK," he said.
"The bombing has created the worst humanitarian crisis in the world."
Lucy Claridge, director of strategic litigation at Amnesty International, said the judgment was "a major step towards preventing further bloodshed".
"This is the first time that a UK court has acknowledged the risks of continuing to lavish Saudi Arabia with military equipment for use in Yemen," she said.
Labour and the Liberal Democrats called for the government to immediately suspend all arms sales for use in the Yemen conflict.
Labour's shadow foreign secretary Emily Thornberry demanded "a full parliamentary or public inquiry" to find out how the breach of law was allowed to happen, and which ministers were responsible.
There has been much public debate about the supply of weapons to Saudi Arabia, particularly in light of the Saudi involvement in the conflict in Yemen.
Research by the Stockholm International Peace Research Institute, a think tank which monitors the global weapons industry, puts Britain in second place as a supplier of "major arms" to Saudi Arabia, behind the United States and ahead of France.
Saudi Arabia's total imports of major arms more than tripled in the period from 2012 to 2017 compared with the previous five years.
This ruling is a blow to the government and to the British arms industry.
More than 40% of UK arms exports are destined for Saudi Arabia.
Last year alone the largest UK defence company, BAE Systems, made £2.6bn worth of sales to the Gulf state.
While the court ruling does not necessarily mean an end to future sales, it does put them in jeopardy.
The government has always insisted it has some of the world's most rigorous arms exports controls. But today's ruling shows they are not tough enough.
The Court of Appeal says ministers have a legal obligation to assess allegations of serious human rights violations before allowing those sales.
In the case of Saudi Arabia's war in Yemen the court clearly stated the government had "made no attempt to do so".
The government says it will appeal against the decision.
But proving that UK jets and weapons have not been involved in serious human rights violations may prove difficult, given Saudi Arabia's conduct in the war.
What is happening in Yemen?
The country has been locked in a seemingly intractable civil war for four years, which has left thousands dead and pushed millions to the brink of starvation.
The conflict began in 2015 when the rebel Houthi movement seized control of much of the west of the country and forced President Abdrabbuh Mansour Hadi to flee abroad.
Alarmed by the rise of a group they saw as an Iranian proxy, the UAE, Saudi Arabia and seven other Arab states intervened in an attempt to restore the government. The US, UK and France have provided logistical and intelligence support to the coalition and sold it weapons.
The UN says at least 7,070 civilians have been killed and 11,205 injured in the conflict - 65% of the deaths are attributed to Saudi-led coalition air strikes.
Thousands more civilians have died from preventable causes, including malnutrition, disease and poor health.
About 80% of the population - 24 million people - need humanitarian assistance and protection, and almost 10 million are just a step away from famine, says the UN.
Last month, rebels pulled out of three key Red Sea ports in partial implementation of a ceasefire deal agreed last December, according to the UN. This could allow vital humanitarian aid into the country.