ISTANBUL -- President Recep Tayyip Erdogan of Turkey lost his first major political battle with the Trump administration, which is arming the Syrian Kurds who the Turks consider enemies. The question now is what Mr. Erdogan, a headstrong leader, will do next.
The White House made the move to arm the Kurdish fighters, despite vociferous objections from Turkey, because it considers them an effective military proxy in the fight against the Islamic State.
But doing so comes at a cost. Angering Turkey risks a rupture with an important NATO ally that is being courted by Russia, and could have an unpredictable impact on the battle against the Islamic State and the wars in Syria and Iraq.
Mr. Erdogan and his aides have warned for months about taking more aggressive, though unspecified, actions against Kurdish militants -- though in a different stronghold, Iraq. And analysts say such a plan would make some strategic sense.
On Wednesday, Mr. Erdogan's prime minister, Binali Yildirim, added another warning: that arming the Kurds could have "consequences" for the United States and a "negative result." He did not go into detail, promising only that Mr. Erdogan would elaborate when he meets President Trump at the White House next week.
Mr. Erdogan also sharply criticized the Trump administration's decision in remarks quoted by Turkish news media, and said he hoped it would be "reversed as soon as possible."
Analysts believe Mr. Erdogan could now seek a quid pro quo in return for swallowing the American decision to work ever more closely with the Kurds in Syria.
In return, Mr. Erdogan could seek an American green light for a newly forceful intervention against Turkey's Kurdish foes in Iraq, the P.K.K.
Experts said that would mostly consist of Turkey increasing its periodic bombing runs on the militants. But in the most extreme case, the Turks could coordinate a ground operation likely carried out by rival Kurdish forces friendly to Turkey, said Soner Cagaptay, a Turkey expert at the Washington Institute for Near East Policy.
For decades, the P.K.K. has fought an on-and-off insurgency inside Turkey, aided by its bases in northern Iraq. The group has been coordinating lately with Iraqi militias that are backed by Iran, another power that Turkey views as a threat.
"I tend to take the Turkish president at his word," said Aaron Stein, a Turkey specialist at the Atlantic Council, a Washington think tank. "If he keeps telling everybody that he could do something in Iraq, I tend to think he could do something in Iraq."
Striking in Iraq would accomplish some Turkish goals, several analysts said. While it would do little to prevent the Kurdish autonomous areas inside northeast Syria from consolidating, it would isolate those cantons from Kurdish areas in Iraq. It could stop the Kurds from expanding their power in the region further and from possibly bolstering the Kurdish nationalist movement inside Turkey -- Mr. Erdogan's ultimate worry.
It would also make it harder for Iran, a rival for power in the region whose proxies are friendly with the P.K.K., to keep a continuous corridor of influence stretching from Tehran through Iraq and northern Syria to the Mediterranean.
Underscoring the complexity of alliances in the region, the P.K.K. is a parent organization of the Americans' newly official Syrian Kurdish partner. The Syrian group, known as the Y.P.G., has used the chaos of war to carve out de facto semiautonomous zones inside Syria.
Mr. Erdogan "can live with a Y.P.G. statelet in northern Syria," said James F. Jeffrey, a former American ambassador to Turkey. "He can't live with a Y.P.G. statelet that is supported by the U.S. and is linked with Iran."
Analysts say Turkey could move against the P.K.K. around Mount Sinjar in northern Iraq. Turkish officials worry that the group is trying to establish new headquarters there that could give it control of a strategic route between Syria and Iran. (The group's existing Iraqi headquarters are in the Qandil mountains, in another part of northern Iraq.)
Mr. Erdogan declared just last month that Turkey was obliged to keep attacking the P.K.K. on Mount Sinjar "until the last terrorist is eliminated."
"They will do everything they can do to take it out before it becomes P.K.K. headquarters No. 2," Mr. Cagaptay said.
"I think this could be the basis of the Trump-Erdogan deal," Mr. Cagaptay, who is Turkish, said after the Trump administration announcement about arming the Syrian Kurds. "Erdogan looking the other way as Trump moves to take Raqqa" with the Syrian Kurds, while Mr. Trump looks the other way, or even helps behind the scenes, as Mr. Erdogan strikes in Iraq.
A central contradiction now bedeviling United States-Turkey relations is that, while the United States agrees with Ankara that the P.K.K. is a terrorist group, American forces work with its Syrian affiliate so closely that the Kurdish fighters help call in U.S. airstrikes. And those Syrian militants will now receive heavy machine guns and armored vehicles from the Pentagon.
Turkey's foreign minister, Mevlut Cavusoglu, said on Wednesday that "every weapon" that goes to the Syrian Kurdish group is "a threat against Turkey."
Taking on the Syrian Kurds more forcefully would be difficult. Besides the militants' close relations with the United States, the Turkish Army is considered too weak, and Kurdish militias in Syria too strong.
Militarily, "the Turks are not in a position to take this on," said Naz Durakoglu, who helped develop Turkey policy at the State Department during the Obama administration.
After at least a dozen Turkish attacks on the Syrian Kurdish militants last month, the United States took emphatic steps to prevent further clashes, by moving troops to the border in Humvees as a buffer between Turks and Syrian Kurds.
They even flew American flags, a symbolic and provocative move usually avoided in Middle Eastern interventions.
That leaves Iraq, where Turkey would face fewer obstacles. The P.K.K. there does not operate under the cover of Syrian Kurds and would therefore not be supported by Washington.
Mr. Erdogan could likely count on the backing of the dominant Kurdish faction in northern Iraq, which controls Iraqi Kurdistan and has a difficult relationship with the main Kurdish groups in Turkey and Syria.
But if Turkey did move on Mount Sinjar, easing one geopolitical headache for Washington in Syria, it would create new complications for another American partner, the Iraqi government in Baghdad.
In yet another indication of the complexity of the battlefield, the United States works indirectly with Iranian-backed Iraqi Shiite militias against the Islamic State.
The Iraqi government, which balances ties between the United States and Iran, relies heavily on those Iran-backed militias to assist its military. Baghdad would not look kindly on a Turkish incursion into its territory, which it would see as a provocative act and a disruption of its fight against ISIS.