MOSCOW — Russia will begin delivering its S-400 air defense system to NATO member Turkey in the coming days, a Kremlin spokesman said Friday, in a deal likely to trigger U.S. sanctions and test the bonds of the Western military alliance.

But the scope of the possible response from Washington remains clouded by apparent conflicting messages.

President Trump has publicly shown sympathy for Turkish President Recep Tayyip Erdogan’s decision to purchase the Russian air defense system. Secretary of State Mike Pompeo, however, has warned of tough measures, such as canceling sales of F-35 fighter jets to Turkey, unless it aborts the deal with Russia.

Also looming is the possibility of mandatory U.S. sanctions against Turkey under a 2017 law on cooperation with “adversaries.” On Friday, the State Department reinforced the warnings of “very real and negative consequences” for Turkey.

Meanwhile, for the wider NATO alliance, the Turkish deal strikes at the heart of military coordination.

NATO has expressed worry that the S-400 is incompatible with Turkey’s possession of the U.S.-made F-35s and could give Russia access to secrets of its stealth technology.

The U.S. measures, if carried out, would cause an extraordinary breach in U.S.-Turkey relations and almost certainly complicate ongoing negotiations between the two countries over other issues, including military strategy in Syria.  

The latest crisis comes less than a year after another argument between the United States and Turkey: over the imprisonment of Andrew Brunson, an American pastor, which led both countries to impose sanctions and dealt a blow to the Turkish economy. 

Erdogan “has made his decision, and we are going to live through the consequences,” said Aaron Stein, the director of the Middle East program at the Foreign Policy Research Institute in Philadelphia. “If you thought Brunson was bad — this is far, far worse.”  

Erdogan has said that his deal with Russia is part of Turkey’s sovereign right to defend itself and denied that the purchase threatened NATO.  

“Turkey adds value and strength to NATO, too, and expands its vision and scope,” he said at a graduation ceremony at the National Defense University in Istanbul on Friday, according to his office. 

“As we defend the rights of our country and our friends in the international arena, we see that the embargoes that we are exposed to in the defense industry increase,” Erdogan said.  

While U.S. officials have portrayed the sanctions against Turkey as a matter of certainty, Trump refrained from taking a hard line with Erdogan over the S-400s during talks last month at the Group of 20 summit in Japan. Both leaders have touted their warm personal relationship — a bond that Trump said helped win Brunson’s release in October.

Trump, speaking to reporters at the summit, noted that Turkey boosted U.S. jobs by paying a “tremendous amount of money” on the F-35 fighters, made by Lockheed Martin. He said Erdogan had first sought to buy Patriot missiles from the Obama administration but had been “treated very unfairly.”

“It’s a mess. It’s a mess,” Trump said. “And honestly, it’s not really Erdogan’s fault,” he added, in comments that appeared to contradict his administration’s vigorous opposition to Turkey’s purchase.  

In fact, both the Trump and Obama administrations had attempted to sell the Patriot systems to Erdogan’s government, but in both instances Turkey sought better terms and negotiations fizzled or stalled.

Turkey found it much easier to come to an agreement with Russia.

Erdogan’s government dropped Turkey’s “traditional heavy-handed demands for technology transfer” to gain the know-how to build its own missile systems, said Stein.

“Russia then bent over backward to ensure that its off-the-shelf delivery wasn’t delayed, by offering to expedite delivery” of the S-400s, he added.   

At the G-20 summit, Trump did not directly answer questions about whether the United States would impose sanctions on Turkey.

Erdogan, however, said after his talks with Trump that Turkey would be spared the sanctions.

Washington has threatened to impose sanctions under the Countering America’s Adversaries Through Sanctions Act (CAATSA), which mandates U.S. sanctions against anyone making a “significant” deal with the Russian defense industry. 

“The United States has consistently and clearly stated that Turkey will face very real and negative consequences if it proceeds with its S-400 acquisition, including suspension of procurement and industrial participation in the F-35 program and exposure to sanctions,” said a State Department spokesman.

Last month, the Pentagon, in a show of determination, said it would halt the training of Turkish pilots to fly the F-35 warplane.

“Turkey’s purchase of the Russian S-400 air and missile defense system remains incompatible with the F-35 program. Turkey will not be permitted to have both systems,” Lt. Col. Mike Andrews, a spokesman for the Pentagon, said in a statement Friday.

“The department remains hopeful that Turkey will change course on the S-400. None of the planning steps we are taking to unwind Turkey’s participation in the F-35 program are irreversible,” Andrews added. “This deliberate, measured approach, intended to allow our Turkish counterparts to adjust to this transition, will be greatly accelerated if Turkey accepts delivery of the S-400.”

The language of CAATSA leaves unclear whether sanctions would be triggered when Turkey takes delivery of the Russian system or after deployment of the S-400s, which is probably still several months away. The White House is weighing several packages of sanctions, of varying severity. Trump could also suspend the sanctions for up to 180 days after they are set in motion. 

But according to the “spirit and letter” of CAATSA, Turkey should not qualify for such a suspension, which is mainly intended for countries discarding legacy Russian systems, Stein said.  

“Turkey is going the opposite direction,” he said. “It is essentially a purchaser of American equipment and divesting away from the U.S. in favor of Russia.”  

Asked by a reporter during a telephone briefing if Russia would deliver the system Sunday, Kremlin spokesman Dmitry Peskov said, “I can confirm on behalf of the Kremlin that the S-400 deal is going according to plan.”

Turkey’s private broadcaster Haberturk said the first shipment of S-400s would be loaded onto cargo planes Sunday and arrive in Turkey sometime next week.

India also wants to buy S-400s from Russia, and it has defied the threat of U.S. sanctions by finalizing a deal to buy five S-400 batteries for $5.4 billion. Russia supplies many weapons systems to India.

India has asked for waivers from U.S. sanctions, and the deal complicates the administration’s desire to expand trade and diplomatic relations with New Delhi. U.S. officials have said they are “urging” India not to buy the Russian missile system and “encouraging” it to find alternatives so as not to trigger sanctions.

But during Pompeo’s visit to New Delhi last month, India showed little sign of backing down. Asked about the S-400 purchase in a news conference with Pompeo, Foreign Minister Subrahmanyam Jaishankar replied that India will act in its national interest and noted that its relationships with other countries “have history.” 

Pompeo said the two countries are friends and partners, and he vowed to “find a way to work through” the differences.

Fahim reported from Istanbul. Carol Morello, Paul Sonne and Karen DeYoung in Washington contributed to this report.