Defense Secretary Jim Mattis on Tuesday urged peace talks to bring an end to the devastating war in Yemen while also defending U.S. support of Saudi Arabian war planes that have been accused of targeting civilians.

“This has got to end, we’ve got to replace combat with compromise,” Mattis said during an appearance at the U.S. Institute of Peace.

The secretary said peace talks could be at hand after a summit in Bahrain where he discussed bringing an end to the three-year-old war between a Saudi and United Arab Emirates coalition and Houthi rebels backed by Iran.

“The longer-term solution, and by longer term I mean 30 days from now, we want to see everybody around a peace table based on ceasefire, based on a pullback from the border, and then based on ceasing dropping bombs that will permit the [United Nations] special envoy … to get them together in Sweden to end this war. That is the only way solve this,” Mattis said during an hourlong conversation at USIP with former Bush administration official Stephen Hadley.

The U.S. has been providing intelligence and aerial refueling support to the Saudis as the war grinds on and remains among the world’s worst humanitarian disasters.

That support has come under scrutiny following recent reports of Saudi airstrikes killing civilians, including 40 children who were riding in a school bus in August, as well as the kingdom’s apparent murder of U.S.-based journalist Jamal Khashoggi at one of its consulates.

Some members of Congress have called for an end to the support.

Mattis insisted that the Khashoggi murder is a separate issue that President Trump has promised to investigate, and said that the U.S. is also working with its longtime ally to make Saudi military operations less dangerous for innocent Yemenis.

“For months we have been holding classes of how do you actually establish ‘no fire’ areas, what do you do for restricted fire areas, how do you calculate the effects of bombs, how do you then investigate what happened?” Mattis said. “Some people have a very high expectation as demonstrated by the U.S. or the NATO air forces of what can be accomplished.”

With peace talks possible next month, Saudi leaders have taken the U.S. lessons on precision warfare to heart, Mattis said.

“The commander of the Royal Saudi Air Force has been going base to base as we continue the training and the conferences for them, and he’s looking his pilots in the eye explaining that there is never reason to drop if they think they can’t hit the right target,” he said.