So long as the Syrian civil war grinds on and the Islamic State continues expanding its footprint, desperate refugees will keep flowing from places like Syria. Unfortunately, addressing the root causes of either the Syrian conflict or the rise of ISIS is beyond the scope of what the United States and its allies can reasonably do. Calls on Syrian President Bashar al-Assad to negotiate with rebel fighters have proven wholly ineffective to date, while greater military involvement in Syria is neither wise nor justified on U.S. national-security grounds.

But as horrifying as it has been, the refugee crisis offers the outlines of a new strategy—one both morally superior to the current do-little approach and practically superior to additional military intervention. In short, the United States and its European allies should plan to take in all refugees fleeing violence in Syria, with the help of other willing nations around the world.

Proposals by American hawks such as Senators Lindsey Graham and John McCain to use U.S. ground troops to confront ISIS or remove Assad from power are clearly misguided. After all, the United States simply does not have enough of a national-security interest in either goal. Beyond this, Russia’s new military campaign in Syria now makes U.S. intervention far more complicated and hazardous—by adding heightened U.S.-Russian hostilities to the list of potential consequences. And finally, escalating the U.S. military campaign is unlikely to make things better. Though it would probably, in the short run, alter the balance of which groups suffer the most casualties, the central lesson from the wars in Afghanistan and Iraq is that even an extended U.S. military presence cannot promise an end to conflict. Though U.S. military action can topple governments, destroy buildings, and kill people, it cannot defeat ideas or prevent the spread of extremism and the mobilization of extremist groups. Indeed, the Islamic State might not exist today had it not been for the invasion of Iraq and the radical weakening of the Iraqi state that followed. Fourteen years after the invasion of Afghanistan and 12 years after the invasion of Iraq, neither nation is a safe place to live—both are themselves producing refugees in large numbers.

The most popular military alternative in Syria, recently revived by Hillary Clinton, is to establish a no-fly zone and humanitarian corridors where the United States could both protect civilians from Assad’s bombing campaigns and keep them from having to flee the country. Russia’s campaign in support of Assad, however, makes this dangerous and impractical because it raises the risk of confrontation between U.S. aircraft enforcing a no-fly zone and Russian aircraft attacking nearby targets. Even if such an effort were practical, partial solutions like this are likely to lock civilians into refugee camps to the detriment of both the refugees and the United States. In such camps, refugees often suffer serious health risks, predation from their neighbors, economic difficulties stemming from prolonged unemployment, and mental-health strain related to all of the above. Moreover, many refugee camps have also become sources of radicalization and political violence. In short, such camps produce terrible results.

Going in militarily is not the answer, then. Instead, those civilians under threat should get out. Refugees typically receive support in the countries to which they flee, but the vast numbers involved in this case threaten to overwhelm Turkey, Jordan, and Lebanon, which have so far accommodated the vast majority of the outflow. The United States could better employ the resources it has already demonstrated a willingness to expend in Syria by opening its doors to refugees and encouraging its allies, in the European Union and elsewhere, to do the same. The Obama administration has so far promised to take in just 10,000 Syrian refugees in 2016. Meanwhile, European countries like Germany (which has pledged to admit 800,000 asylum-seekers, including Syrians, this year), Britain (which has pledged to admit 20,000 Syrians over the next five years), and France (which has pledged to admit 24,000 Syrians over the next two years) have committed to making significant contributions on this front. These expressions of a desire to find a solution, and the will to implement it, could be further leveraged.

For many refugees, resettlement could take the form of medium-term stays in host countries until it becomes possible for them to return home. For others, however, it could mean permanent resettlement. Without question the scale of the Syrian crisis, which has so far produced 4 million refugees, will make this process difficult. But there are precedents for this kind of long-term resettlement, albeit on a smaller scale. Almost 700,000 Vietnamese refugees were resettled elsewhere in the wake of the Vietnam War, while hundreds of thousands fleeing conflicts in Russia, Iraq, Bosnia, and Kosovo have also found new homes around the world.

Most importantly, an open-door resettlement policy would save thousands of lives and improve the life prospects of millions more. The declared goals of Western intervention in Afghanistan, Iraq, Libya, and against the Islamic State in Syria and Iraq have included the freedom and well-being of the people in those countries. Sadly, military campaigns by the United States and U.S.-led coalitions in such places have failed to provide any such thing. An open-door policy would finally provide concrete benefits to these people, and represent a morally superior alternative to forcing refugees to remain in dangerous camps or sending them back to deadly conflict zones.

This approach is also practical and more affordable than the leading alternatives. The United States alone offers legal permanent residence to some 1 million immigrants a year, and has welcomed over 3 million refugees since 1975. For those who think finding new homes around the world for Syrian refugees will be prohibitively difficult, consider that over 9 million people emigrated from China in 2013 alone. A broad international coalition could surely accommodate 4 or 5 million refugees from Syria—or even more—over the next few years.

Moreover, though resettlement would cost real money, it would likely cost far less than deeper military intervention and would pale in comparison to the price that the United States has already paid for its failed Middle East occupations. The Australian government estimates that its plan to permanently resettle 12,000 Syrians will cost roughly $15,000 per refugee per year over four years—a figure that’s remarkably similar to the $15,700 per refugee that the United States spent to bring in 70,000 refugees in 2014. Extrapolating from these numbers yields a very rough estimated cost of about $60 billion per year to resettle 4 million refugees. In the most simplistic scenario, if the 30 countries that have already promised to take in at least some Syrians split the burden evenly, each country would be responsible for 133,000 refugees at a very reasonable price of $2 billion a year. Assuming the United States took in double that number of refugees given its geographic size and economic strength relative to other countries in the mix, it would still cost about as much as its year-long air war against the Islamic State, which so far has resulted in a stalemated battlefield. Even no-fly zones can be expensive; no-fly zones over Iraq between 1996 and 2001 cost the United States an average of $1.3 billion (or 87,667 resettled refugees) per year.

The costs of military involvement on the scale of the Iraq and Afghan wars are starker still. In total, the cost of those conflicts will wind up draining the United States of somewhere between $4 trillion and $6 trillion. In 2014, the United States spent about $88 billion to maintain its presence in Afghanistan alone. Though nobody in the United States is currently proposing a military campaign on such scale in Syria, these figures make clear that the cost ceiling for war is far, far higher than that of resettlement. On the human side of the ledger, the accounting of those wars is even starker. The United States has already lost almost 7,000 Americans to the fighting in Iraq and Afghanistan, with over 50,000 wounded in action, while hundreds of thousands of Afghans and Iraqis have died in the fighting; Syrian civilians are already dying in the U.S.-led air campaign in their country. A policy that focuses U.S. effort on saving lives rather than taking them represents an immeasurable improvement.

It’s a shame as well as a missed opportunity that anti-refugee sentiment and polarizing immigration politics in both the European Union and the United States will make it extremely difficult to enact what amounts to the best available response, both morally and financially, to Syria’s war and its resulting refugee crisis. Concerns about the purported national-security threat posed by refugees make little sense in the absence of evidence that refugees have ever presented such a threat on a large scale. In fact, an open-door policy is likely to make Americans, and those in other Western countries, safer over the longer term by challenging the perception, so susceptible to exploitation by extremists, that the United States and its allies care very little about the people of the Middle East. By dialing back on military action while opening its doors to refugees, the United States would demonstrate that Arab lives matter, while providing a powerful counterweight to the narrative put forth by ISIS.