According to just war theory, military campaigns should only be fought as a last resort, with the goal of correcting a grave evil, and where there is a high probability of success. But what happens when a military campaign unravels and becomes unwinnable? How can a leader reconcile just war theory with the need to extricate the country from a quagmire? In recent decades, US presidents have repeatedly faced such moral dilemmas, as campaigns in Korea, Vietnam, Afghanistan, and Iraq all became unwinnable. When victory is no longer achievable, leaders should dial down the goals of the war, resist the pressure to embrace barbarism, negotiate with the adversary, and seek the best possible peace from the range of plausible alternatives.