The legacy of the Afghan War—now in its 18th year—will similarly depend on whether civilians, veterans, and current military personnel believe the United States won or lost.

In fact, we can make plausible inferences regarding how civilian and military opinions might evolve if a deal is struck. Drawing on an original survey administered for us online by the National Opinion Research Center to 4,500 American adults in late June and early July, the two of us have been studying public attitudes toward the military. In addition to a large number of civilians who had never served in the military, we also reached as many as 700 veterans and 200 active-duty personnel from the various services. (Although our sample of active-duty troops is relatively small, previous surveys have shown that on some key foreign-policy, national-security, and military-policy issues, veteran attitudes track fairly closely with active-military attitudes, and our survey appears no different.) Three major themes emerged from our research:

First, although Americans don’t think the war in Afghanistan is a mistake, they’re probably ready for it to end. In our survey, only 29 percent of respondents told us they believed the Afghan War was a mistake; 45 percent believed it wasn’t a mistake, while 26 percent were unsure. Unlike opinions on the Iraq War—which a supermajority of Democrats but only a minority of Republicans believe was a mistake—opinions on the war in Afghanistan showed few partisan or civil-military gaps. Only 31 percent of Democrats and 21 percent of Republicans told us the war in Afghanistan was a mistake; just 30 percent of veterans and 29 percent of nonveterans said the war was an error.

Read: The promise presidential candidates never make good on

Still, President Donald Trump has some basis for thinking a troop withdrawal by the 2020 election would be “job-enhancing” for him, as he reportedly told Secretary of State Mike Pompeo late last month. Even though most Americans don’t think the war was a mistake, they appear ready for American troops to come home. When asked whether they would support the decision if Trump authorized the withdrawal of U.S. troops, 55 percent said yes, and only 23 percent said no. Sixty-seven percent of Republicans would back a troop withdrawal by Trump, but Democrats were not far behind; 57 percent of them would approve. Approximately 55 percent of both veterans and nonveterans told us they would support a troop withdrawal, along with an overwhelming 72 percent of those on active duty.

Second, whether or not troops come home might not be the only thing that matters. The terms of an agreement with the Taliban and how that agreement is framed—as a victory or defeat—will influence public support for the deal, especially among veterans and active-duty troops.