Iran’s Foreign Ministry said Saturday that it would not agree to any changes to the nuclear deal, as President Trump has demanded, and it vowed a “serious response” to new U.S. sanctions that it said crossed a red line.

The countries that negotiated the multilateral 2015 agreement with the United States were thrown into confusion, anger and disapproval over Trump’s ultimatum Friday to withdraw from the deal within months if his conditions are not met.

Trump is insisting on changes to the nuclear deal and U.S. law that would be difficult if not impossible to finesse. He wants Iran to allow the immediate inspection of all sites as requested by U.N. inspectors, and he demands no lapse of the “sunset” provisions imposing curbs on Iran’s nuclear program. He also wants Congress to modify U.S. law to link missile tests to nuclear weapons programs, as well as impose trigger points that would automatically snap sanctions back into place.

Russia called Trump’s remarks “extremely negative.” China said the deal now faces “complicating factors.” And the European Union said it would “assess” the implications.

But the strongest reaction came from Tehran, which agreed under the deal to curb its nuclear program and allow intrusive inspections of its nuclear facilities in exchange for relief from punishing economic sanctions. Trump reluctantly extended waivers on the sanctions Friday but said it was the last time he would do so without the changes.

A Foreign Ministry statement reported by the state-run Islamic Republic News Agency said Iran “will not accept any change in the deal, neither now or in the future.”

It also said Iran will “not take any action beyond its commitments.” It specifically mentioned its refusal to agree to linking its nuclear commitments, which even the Trump administration acknowledges Iran is technically adhering to, with other issues such as ballistic missile tests. Trump proposed that continued sanctions relief be tied to Iran’s ongoing missile tests, which do not currently violate the narrow nuclear accord.

The statement came a day after Foreign Minister Mohammad Javad Zarif tweeted that the nuclear deal is “not renegotiable” and demanded that the United States live up to its own commitments under the agreement — “just like Iran.”

The Foreign Ministry also expressed its pique over the sanctions against 14 individuals and entities, in particular one announced Friday against one of the most senior and politically connected officials in the country, judiciary chief Sadegh Larijani. The ministry said targeting Larijani was illegal and a “hostile action” that had “crossed all red lines of conduct in the international community.” Officials promised to retaliate but did not specify how.

The countries that negotiated with Iran alongside the United States seemed to be caught off balance by Trump’s demands for changes.

China was caught in the middle and said it would play a “constructive role.” Chinese Foreign Minister Wang Yi talked by phone with Zarif. He told him the deal had not been “derailed” but must now confront “some new complicating factors,” the state news agency Xinhua reported Saturday.

In Moscow, Deputy Foreign Minister Sergei Ryabkov called Trump’s remarks “extremely negative,” according to the RIA Novosti state news agency. “Our worst fears are being confirmed,” he said.

But the Europeans face the biggest dilemma.

Senior administration officials said the United States will discuss with them the modifications Trump demands but will not speak directly with Iran. In effect, the president is asking the Europeans to act as mediators to accomplish changes Iran refuses to make.

Britain, France, Germany and the European Union all helped negotiate the deal, and the agreement is as much with them as it is with the United States and Iran.

But while Europeans also are concerned about Iran’s behavior regarding non-nuclear issues, they have called the nuclear agreement successful and essential to their security. They also have said they don’t think it realistically can be modified and have urged the United States to stick to its commitments and work separately on issues such as human rights abuses, corruption, ballistic missile testing and Iran’s support for militant groups in other countries.

The next sanctions waivers come up for renewal in May, but Trump may not wait that long.

“If at any time I judge that such an agreement is not within reach,” he said in a statement Friday, “I will withdraw from the deal immediately. No one should doubt my word.”