In one fell swoop, President Trump just changed the future course of the war against ISIS — and alienated a vital American ally along the way.

That’s because of a new US move to arm the People’s Protection Units (YPG), a Syrian Kurdish militia that has emerged as one of Washington’s most important battlefield allies in the fight to push ISIS out of its de facto capital in the Syrian city of Raqqa. A full-scale, US-assisted offensive to reclaim the city is expected soon.

Turkey, a vital NATO power and anti-ISIS ally, is not taking this news lightly. Today, in a press conference alongside President Trump, Turkish President Recep Tayyip Erdoǧan’s visit said arming the YPG must “never be accepted.”

Last week Turkey threatened to take military action against the YPG in closed-door meetings with US national security officials, per the Washington Post.

“Turkey’s message to the Trump administration was that Turkey reserves the right to take military action,” a senior Turkish official told the Washington Post.

The Pentagon’s top spokesperson, Dana White, had announced Tuesday that Trump authorized the Department of Defense “to equip Kurdish elements of the Syrian Democratic Forces as necessary to ensure a clear victory over ISIS in Raqqa.”

This was a move Gen. Joseph Votel — whose perch at the helm of the military’s Central Command means he oversees the US wars in Iraq, Syria, Afghanistan, and Yemen — signaled all the way back in February. At the time, Votel said the US “would be transparent” with Turkey about its aid to the Kurds.

There has been no official word about what kinds of weaponry the YPG will get, but 120mm mortars, machine guns, ammunition, and light armored vehicles are possibilities, reports the Guardian. Artillery and surface-to-air missiles have been ruled out, at least for now.

The plan is to give the YPG the materials it needs to help take Raqqa and then limit the amount that gets to them once the fighting has stopped. Meanwhile, Trump has nearly doubled the number of US troops in northern Syria, now totaling around 900, to provide artillery support and training.

And while the United States already provided gear to the YPG like night vision goggles and rifles, this is the first time Washington is publicly admitting it is providing weapons to help win a part of the war.

Fred Hof, President Obama’s special adviser for transition in Syria who is now at the Atlantic Council, told me in an interview he thinks the Pentagon “grew weary of denying reports it was already arming the YPG. The new announcement at least regularizes matters.”

There was a reason the Pentagon had spent so many months playing down its ties to the YPG: Turkey, a NATO member that fears the militia is helping the PKK claim an independent Kurdistan, which would take away Turkish territory.

The US silence about something everyone knew was happening didn’t really succeed in placating Turkey — and Trump’s decision to go public will just make the frosty ties between Ankara and Washington even frostier.

"Every weapon that they deliver is a threat to Turkey," Turkish Foreign Minister Mevlut Cavusoglu told reporters after the US decision was announced.

Washington loves the Kurds. Turkey doesn’t.

Here’s why Erdogan and Cavusoglu are so angry.

Ankara considers the YPG to be part and parcel of the Kurdistan Workers’ Party, or PKK, a Turkish Kurdish group that had waged a bloody fight for autonomy from Turkey since the 1980s. Turkey and the United States label the PKK as a terrorist group.

In 2015, a ceasefire between the PKK and Turkey ended after Erdoǧan vowed to “liquidate” the group. Since July 20, 2015, the ceasefire’s end has led to at least 2,748 deaths, according to the International Crisis Group.

And in April, Turkey bombed YPG militia members in Iraq and Syria. So clearly Turkey is not a big fan of the Kurds.

Here’s what’s important to keep in mind: Trump’s announcement effectively admitted that America provides weaponry to the YPG, a militia Turkey thinks is an enemy of the state.

That’s going to make Erdoǧan’s May 16 visit to Washington super awkward, assuming that Erdoǧan doesn’t call it off first (which seems unlikely; the relationship, even if strained, is hugely important to both governments).

For what it’s worth, White is “keenly aware” of the weird spot Trump’s YPG policy puts Turkey in. She told CNN yesterday that the arming of the YPG will be “limited, mission-specific, and metered out incrementally as objectives are reached,” a message clearly meant to assuage Turkish fears.

The YPG couldn’t be happier, though. A YPG spokesperson also told CNN that it was a “historical decision” that will allow the group to continue fighting terrorism.

Regardless, the Trump administration’s decision to arm the YPG officially makes the war against ISIS more complex, and could potentially hurt America’s role in it.

“This is a mistake,” James Jeffrey, a former US ambassador to Turkey, bluntly told USA Today.

His main concern is that Turkey may deny America the use of its Incirlik Air Base, located in Turkey’s south near Syria. Turkey agreed in July 2015 to let US warplanes and drones fly out of the facility for bombing and surveillance missions against ISIS.

That matters because having a base near where the fighting takes place makes it easier to get involved when necessary.

“It’s hard to imagine a successful campaign against ISIS without our bases in Turkey,” Jeffrey continued.

Even by arming the YPG, the battle to take Raqqa will still be one hell of a fight, according to Hof.

“Using militiamen to do the ground combat in a complex urban environment may, absent a healthy ration of good luck, produces less than optimal results, especially for civilians caught in the crossfire,” he told me.

ISIS lost about a quarter of its territory last year, and Secretary of Defense James Mattis wants to make sure that trend continues. He said that America plans to “further accelerate” the fight against ISIS.

The decision to arm the YPG appears to be part of that acceleration. The only question is whether it will actually help — or whether it could, paradoxically, set things back.