President Trump said Tuesday that the United States will cancel the purchase of more than 100 F-35 fighter jets by Turkey because of its acquisition of a Russian antimissile defense system, even as his administration indicated it was still wrestling with sanctions mandated under U.S. law.

“It’s not a fair situation,” Trump told reporters as he began a Cabinet meeting. Making clear his reluctance to ban the aircraft sale, Trump repeated his contention that Turkey, a NATO ally, was forced to meet its defense needs by buying the Russian S-400 system because the Obama administration would not sell it the U.S.-made Patriot system.

State Department spokeswoman Morgan Ortagus said that Secretary of State Mike Pompeo and Trump were “closely reviewing” the sanctions legislation and “will make a decision based on what they are required to do under U.S. law.”

The 2017 Countering America’s Adversaries Through Sanctions Act (CAATSA), which also applies to North Korea and Iran, requires punitive U.S. measures against any entity that has “significant” dealings with the Russian defense industry.

The law outlines 12 economic and other sanctions from which the president must choose at least five. It is unlikely that Turkey would be eligible for a national security waiver contained in the legislation, which requires a recipient country to be demonstrably downgrading its security relationship with Russia, rather than enhancing it.

Any attempt by Trump to waive sanctions would be likely to run into strong bipartisan opposition in Congress. “I think their only option there is . . . what sanctions they should have,” said Sen. James Lankford (R-Okla.), who co-wrote separate legislation requiring the administration to cancel Turkey’s F-35 purchases — as well as Turkey’s participation in building the plane — if it bought the Russian system.

Sen. James E. Risch (R-Idaho), the chairman of the Foreign Relations Committee, said that the situation was “nothing to be trifled with. We need to do exactly what we’ve said we were going to do.” Turkey, Risch said, “need[s] to look in the mirror and really, soberly assess which side of the line they want to be on.”

Democratic colleagues agreed. “The whole point of enacting CAATSA was to say to countries that were considering closer partnership with Russia on a strategic basis, ‘There will be consequences,’ ” said Sen. Christopher A. Coons (D-Del.).

Though State Department, Pentagon and White House officials have warned repeatedly over the past year that sanctions, and termination of the F-35 sale, were inevitable if Turkey’s purchase of the S-400 defense system proceeded, Turkish President Recep Tayyip Erdogan has said he thinks Trump will find a way to avoid taking action.

Trump expressed sympathy for Erdogan’s position last month after the two leaders met at the Group of 20 summit in Japan, saying that Turkey was not “treated fairly” by the Obama administration when Ankara tried to buy the Patriot system. Other administration officials have said that is not true, that Turkey did not like the terms offered by either the Obama or Trump administrations. Trump administration efforts to strike a deal on the Patriots, officials said, continued until the S-400 delivery began.

NATO has said that alliance member Turkey’s possession of the S-400 is “incompatible” with deployment of the F-35, because the aircraft’s stealth technology could be vulnerable to being compromised if it is in proximity to the Russian system. The imposition of U.S. sanctions would mark the first time one member of the alliance has taken such action against another.

“You’ve also not had a NATO ally go purchase Russian equipment,” Lankford said.

Sen. Marco Rubio (R-Fla.), who said a sanctions waiver “would be a mistake,” raised what he said were “legitimate questions” about possible Turkish retaliation. Turkey, he said, could place restrictions on U.S. use of Turkey’s Incirlik air base to launch bombing raids into Syria and Iraq, and could step up its military aggression against Kurdish allies of the United States in northeastern Syria.

Mark Esper, Trump’s nominee to be defense secretary, said Turkey’s decision to go ahead with the Russian purchase was “disappointing.” Esper, who served as acting secretary until his nomination this week, told the Senate Armed Services Committee on Tuesday that he had warned the Turkish defense minister that “you can either have the S-400 or you can have the F-35. You cannot have both.”

Confirmation of the F-35 cancellation followed Turkey’s observance Monday of the third anniversary of a failed coup against Erdogan’s government in which more than 250 people were killed. During the coup attempt, a renegade faction in the military was able to commandeer F-16 warplanes, that at one point, were sent to shoot down Erdogan’s plane. That was a factor, diplomats and analysts said, in the Turkish president’s decision to purchase the Russian air defense system — which Moscow promised it could deliver faster and at a lower price than the Patriot system.

S-400 components have been delivered over the past few days to the same air base outside of Ankara that the coup plotters used as a base of operations.

The S-400 “will be assembled completely by April 2020,” Erdogan said in Istanbul at one of Monday’s events. “Eight planes have come. And the others are coming,” he said of the Russian deliveries. “We stood tall, we did not become hostile. But we are Turkish — we stand behind the promises we make.”

Turkey received more components of the air defense system Tuesday as another Russian cargo plane — the 12th so far — arrived at the Murted air base, according to the state-run Anadolu news agency.

As Erdogan’s government braced for sanctions from the White House, Ankara was dealt another economic blow this week when the European Union imposed its own sanctions over Turkey’s drilling for gas in the eastern Mediterranean. On Monday, the E.U. announced that it was suspending talks with Turkey over an aviation agreement and was reducing financial assistance. E.U. foreign ministers, meeting in Brussels, also said they would ask the European Investment Bank to review lending to Turkey over the drilling near the island of Cyprus.

Cyprus has been ethnically divided, since Turkey invaded it in 1974, between the Greek Cypriot south and the Turkish Cypriot north. Only Ankara recognizes the self-proclaimed northern government. Turkey has defended sending ships to drill for gas around the island by saying that both Turkey and the Turkish Cypriots possess exploratory rights.

Turkish Foreign Minister Mevlut Cavusoglu brushed off the sanctions Tuesday and vowed that Turkey would send an additional ship to the eastern Mediterranean. “If you take such decisions against Turkey, we will increase activities,” he said during a visit to North Macedonia, according to Anadolu.

Fahim reported from Istanbul.