Continued military support to nations engaged in the war in Yemen will depend on the extent of their efforts to avoid civilian casualties, Defense Secretary Jim Mattis said Tuesday, as pressure builds on Saudi Arabia and its allies to protect noncombatants.

U.S. assistance, which includes aerial refueling, weapons sales and intelligence sharing, “is not unconditional,” he said.

Speaking to reporters at the Pentagon, Mattis said aid to countries conducting operations against Houthi rebels would require that those countries “do everything humanly possible to avoid any innocent loss of life and they support the U.N.-brokered peace process.”

The comments came hours after the United Nations human rights office released a report accusing all of the parties involved in Yemen’s conflict of violating international law.

The findings by a team of U.N. investigators zeroed in on airstrikes by the coalition led by Saudi Arabia and the United Arab Emirates, two close U.S. allies. The strikes, which have hit markets, funerals, weddings and hospitals, “have caused most direct civilian casualties,” the United Nations said in a statement.

The U.N. investigators said individuals in the coalition and the internationally recognized Yemeni government, which the coalition and Washington are seeking to restore to power, may have conducted attacks that could “amount to war crimes.”

“There is little evidence of any attempt by parties to the conflict to minimize civilian casualties,” Kamel Jendoubi, the head of the investigations team, known as the Group of International and Regional Eminent Experts on Yemen, said in the statement. “I call on them to prioritize human dignity in this forgotten conflict.”

More than 17,000 Yemeni civilians were killed or injured between March 2015, when the civil war began, and last week, according to data compiled by the U.N. human rights office. The actual toll, the United Nations says, is likely to be significantly higher.

The 41-page report also detailed other violations by all parties, including blocking access to humanitarian aid, recruitment of child soldiers, sexual violence, arbitrary detentions and disappearances.

Restrictions at air and sea ports that have prevented aid, medicine and other supplies from entering Yemen may also constitute a violation of international humanitarian law, the U.N. investigators said.

The Saudi Arabia-led coalition said in an email that it would respond to the U.N. report after its legal team reviews the findings.

Anwar Gargash, the UAE minister of state for foreign affairs, said his government would review the panel’s findings and highlighted its conclusions regarding Houthi attacks on civilians. “In the end we are responsible for our security and stability and that is our priority,” he said on Twitter.

Mohammed Albukhaiti, a Houthi political official, criticized the report, saying it equated the “intentional crimes” against civilians by the coalition with “mistakes” made by the rebels.

Human rights groups applauded the report and reiterated their demands for an arms embargo. They called for greater scrutiny by the international community, especially the United States and Britain, which sell billions of dollars in bombs, jets and other weapons to the coalition.

“The USA, UK and other states should do everything in their power to prevent further violations and address the catastrophic humanitarian crisis,” Lynn Maalouf, the Middle East research director for Amnesty International, said in a statement. “They should start by immediately stopping the flow of arms to the country and end the coalition’s arbitrary restrictions on humanitarian assistance and essential imports.”

Support for the coalition in Washington has frayed over the past year amid attacks on civilian targets, including an Aug. 9 airstrike that killed more than 40 children on a bus excursion in northern Yemen.

That bombing deepened opposition to the war from U.S. lawmakers, who passed a measure this summer requiring the Trump administration to certify that the coalition is taking certain steps, including protecting civilians, for aerial refueling to continue.

After the strike on the bus, Mattis also ordered a three-star general to discuss coalition air operations with Saudi officials.

But the defense secretary also defended U.S. assistance to the coalition, which he said was deigned to help Persian Gulf nations defend themselves from attacks by Houthi militants. The Houthis, who the coalition partners and Western nations say are backed by Iran, have repeatedly fired missiles into Saudi Arabia.

Shortly after arriving in office, the Trump administration determined that it would continue providing the limited support initiated under President Barack Obama, Mattis said. The administration, which has taken a more supportive posture toward Saudi Arabia than the previous administration, restored certain arms sales suspended under Obama.

“We determined that it was the right thing to do,” Mattis said. “Our conduct there is to try and keep the human cost of innocents being killed accidentally to the absolute minimum.”

Mattis said U.S. efforts to advise the Saudi-led campaign have helped reduce civilian harm. Saudi pilots sometimes refrained from dropping munitions and have established “no-fire” zones around schools and hospitals, he said.

The coalition has made strides, he added, in improving “deliberate” targeting — military officials’ identifying an intended target before launching sorties. But the coalition’s “dynamic” targeting, which takes place when pilots strike sites identified when aircraft are already in flight, requires improvement, he said.

Mattis said the Aug. 9 strike on the bus was a case of dynamic targeting. American officials are awaiting results of an investigation into that attack.

“We have not seen any callous disregard by the people we’re working with. So we will continue to work with them, [to] reduce this tragedy,” he added.

Mattis pushed back against questions suggesting that Yemeni children had been killed by American weapons, even though a recent report showed that the laser-guided bomb used in the attack was sold to the coalition as part of a government-backed sale of U.S. arms.

Raghavan reported from Cairo.