The War on Terror is at a stalemate.

Recent, disparate terrorist attacks have shown that far from being “degraded and destroyed,” the Islamic State’s reach is growing. Unwilling to commit large numbers of U.S. boots on the ground, policymakers have instead doubled down on a “small footprint” approach of military aid to foreign governments. But this strategy is failing.

Contrary to what one might expect, U.S. military aid doesn’t produce willing, cooperative, or effective security partners. Instead, it incentivizes bad behavior and drives the sources of terrorism: corruption, violence, and poor governance. Unwittingly, this policy is creating its own enemies.

The logic of military aid — or security assistance, as it is euphemistically referred to — is twofold: U.S. military equipment, training, and support will build strategic relationships with partner nations and then empower them to fight terrorists on our behalf.

This thinking has led to explosive growth of military aid since 2001. According to the Security Assistance Monitor, the United States is poised to spend almost $20 billion on foreign military assistance in 2016 alone, through programs scattered between the State Department and the Pentagon.

In practice, this logic is severely flawed. Rather than creating cooperative partners, research shows that military aid produces reverse leverage: The more aid given to a recipient country, the less likely it is to do what we want. For example, Pakistan receives $1.6 billion in U.S. military aid every year, but the Pakistani government still supports extremist groups in Afghanistan and has deep ties to the Haqqani terrorist network.

The reason lies with the incentives that U.S. military aid creates.

Limitless and beyond the view of the public, U.S. military aid is a tap foreign governments don’t want to turn off. The longer they’re “fighting terrorists,” the more “security assistance” they get. There’s no reason for them to actually defeat terrorists, because if they did, the cash would go away. Instead, foreign security partners are incentivized to maintain a form everlasting instability, wherein nobody wins and everybody loses.

Unfortunately, the U.S. taxpayer isn’t the only victim. The crimes committed by U.S.-funded security forces are too many to list, but they include bombing weddings in Yemen, sexually abusing children in Afghanistan, and blowing up tourists in Egypt. Western support of these outrages is seldom lost on the local victims.

The perverse irony is that this type of behavior — underwritten and enabled by the United States — is perpetuating terrorism. Research has shown that nothing recruits terrorists like corrupt security forces committing human rights abuses with impunity.

Kenya illustrates this dynamic well. After the horrific attack at the Westgate Mall in 2013, Kenya responded with aggressive policing tactics, arresting and mistreating thousands of Kenyan Somalis and Muslims. That brutal response, however, helped al-Shabaab by inciting anger across the country.

After last month’s attack in Paris, lawmakers on both sides of the aisle called for a more aggressive strategy to counter terrorism. Days later, the State Department finalized a $1.29 billion sale of targeted bombs to Saudi Arabia. It’s hard not to note the irony: How exactly would extending the coercive arm of oppressive states like Saudi Arabia improve counterterrorism efforts?

After 15 years of letting the military take the lead in fighting terrorism, policymakers need to accept that political problems demand political and diplomatic solutions, which are seldom found on the path of least resistance. But the tools needed — robust diplomacy, accountability mechanisms, democracy support — are starved of funding.

As U.S. military assistance grows every year, support for democracy shrinks. During Obama’s tenure in office, democracy assistance funding has declined by almost 30 percent. And while the Pentagon is slated to receive over $600 billion in funding, the State Department and foreign aid account will be lucky to get $50 billion.

By relying on military aid, the United States is fostering a world of endless war and insecurity. For the United States’ so-called security partners, that’s good for business.