The grotesque murder by torture of Jamal Khashoggi by Saudi Arabian government operatives is the latest example of a U.S. ally in the Middle East resorting to lawlessness. For foreign policy reasons, the United States has long ignored human rights abuses by its allies. President Trump has smartly changed course by applying targeted punitive measures when American interests are negatively affected.

When Turkish authorities jailed American Pastor Andrew Brunson on fabricated charges of plotting against President Recep Tayyip Erdogan, Trump invoked the Global Magnitsky Act, which authorizes him to impose financial sanctions and visa bans on foreign individuals and entities responsible for human rights violations or significant corruption.

The president not only imposed financial sanctions against two Turkish officials responsible for Brunson’s detention but also doubled tariffs on Turkish aluminum and steel, a devastating blow to the country’s already crippled economy. Within a few months, Brunson was miraculously released by a Turkish court, citing his punishment fulfilled by “time served.”

For sure, certain countries continue to flaunt their transgressions. Increasingly, regimes are acting boldly, even crossing international borders to quash political adversaries. In the last year, Iran attempted to assassinate opposition activists in Denmark and France. China sent death threats to 20 activists and journalists living in countries as far afield as the United States, Australia and Canada. North Korea assassinated Kim Jong Un’s half-brother in a Malaysian airport, and Russia launched multiple death-by-poison attempts in the United Kingdom. These countries receive little or no financial assistance from the United States nor do they depend on America for security, providing slight incentive to give up their lawless conduct.

Gulf states such as Saudi Arabia are a different animal. U.S. military protection and access to the U.S. financial system are crucial to the kingdom’s existence. After Khashoggi was murdered in the Saudi Consulate in Turkey, Trump imposed Magnitsky sanctions against 17 Saudis who the kingdom claimed were involved. Although critics wanted him to do more, even penalize the crown prince, the president’s decision was savvy. He punished individuals while not harming American interests. Just as financial sanctions grabbed Turkey’s attention, the Saudis have gotten the message. Humanitarian violations will no longer be ignored.

Turkey and Saudi Arabia are not the only Middle East allies inflicting contrived punitive measures on U.S. interests. Kuwait’s officials and banks also profit handsomely from their engagement with the U.S. financial system and thus are acutely vulnerable to Magnitsky sanctions. Yet, the Kuwaiti government sentenced Marsha Lazareva, a prominent business executive and mother of a 5-year-old U.S. citizen, to 10 years’ hard labor and a $72 million fine based on false charges of fraud. During the so-called trial, the court found her guilty without allowing her to present one iota of evidence, not a witness or a document.

Moreover, another U.S. ally and global financial center, the United Arab Emirates (which recently imprisoned a British academic for life for “spying” after a five-minute trial), appears complicit in the Kuwaiti plot. After a real estate sale by a private equity fund that she started, Lazareva wired $496 million in proceeds to Dubai’s state-run bank. Dubai immediately froze those funds, and continues to hold them at the request of Kuwait’s attorney general.

In the meantime, Kuwait is contriving additional charges against Lazareva as a pretext to seize all her money and stiff the fund’s international investors and stakeholders, including Americans and Brits. Falsely imprisoning the mother of a 5-year-old U.S. citizen, a human rights violation, and stealing a half billion dollars, an act fraught with corruption, fulfill both bases for applying Magnitsky sanctions.

During World War II, Winston Churchill said of Joseph Stalin, “I’d form an alliance with the devil himself if it helped defeat Hitler.” But these Middle Eastern countries are not the devil. The U.S. considers and treats them as allies.

Under Magnitsky, the United States can leverage access to the U.S. financial system and ban bad actors from its shores. Using targeted sanctions when there is abusive conduct can deter “allies” from pursuing brazen authoritarian operations against American interests while allowing the United States to continue the necessary relationships with those countries.