President Trump signaled willingness Tuesday to consider what visiting French President Emmanuel Macron called “a new deal with Iran” that would address shortcomings in the existing nuclear pact, even as he continued to criticize the international agreement as “insane.”

Trump also appeared to threaten a military attack if Iran menaced the United States and railed against the hundreds of billions of dollars he said the United States has wasted on Middle Eastern wars with “less than nothing” to show for the effort.

“If Iran threatens us in any way, they will pay a price like few countries have ever paid. Okay?” Trump said during a news conference with Macron.

The French president is visiting the United States this week in hopes he can convince Trump not to abandon the nuclear deal ahead of a May 12 deadline when the United States can effectively pull out of the 2015 pact among Iran and six world powers. Trump has said he would not sign another presidential endorsement of the deal, opening the door to the reimposition of U.S. sanctions unless the agreement could be amended. The White House refers to the ultimatum as “fix it or nix it.”

Macron has spent little time this week publicly defending the pact, instead focusing his efforts on appealing to Trump’s view of himself as an un­or­tho­dox dealmaker by suggesting that a supplemental agreement carrying his imprimatur could address many of the president’s criticisms of the overall deal.

“I think this is what we’ve been agreeing upon today,” Macron said. “It’s not about tearing apart an agreement and have nothing, but it’s about building something new that will cover all of our concerns.”

Macron is the emissary for a European proposal to add safeguards that address some of Trump’s main complaints about the deal reached under his predecessor, Barack Obama. German Chancellor Angela Merkel is to arrive in Washington on Friday and is also expected to press Trump on Iran. The proposed side agreements between the United States and Europe could push for international inspection of Iranian military sites and apply sanctions if Iran crossed certain thresholds in its missile testing.

Such side deals would not change the terms of the international pact itself and would not bind co-signers Russia and China, but they could allow Trump to argue he has improved the deal and provide a reason he could point to for keeping it in place, at least for now.

Macron described “a new deal with four pillars” covering U.S. and European concerns over whether Iran is concealing any current nuclear activities; the prospect that it might return to some activities when provisions of the deal expire in 2025; ballistic missile testing; and Iran’s alleged destabilizing activities in the Middle East.

Syria, he said, falls into the last category. Trump praised French help with allied missile strikes in Syria this month.

While expressing willingness to entertain keeping the United States in the Iran deal, Trump also made clear he has little use for the agreement and seemed to relish the focus on what he will decide with the May 12 deadline approaching.

“Nobody knows what I’m going to do on the 12th. Although, Mr. President, you have a pretty good idea,” Trump said to Macron at the news conference. “But we’ll see, but we’ll see also if I do what some people expect. Whether or not it will be possible to do a new deal with solid foundations.”

Macron said the two leaders discussed the Syrian civil war and Iranian influence there during their long morning of meetings that included an extended session where the two leaders met alone.

Iran has promised to resume nuclear activities it set aside under the deal if the United States breaks the agreement by reapplying nuclear-related sanctions. But Trump had a warning of his own.

“It won’t be so easy for them to restart. They’re not going to be restarting anything,” Trump said at the beginning of a large meeting with Macron and his delegation. “If they restart it, they’re going to have big problems — bigger than they’ve ever had before. And you can mark it down.”

The deal suspended harsh economic sanctions on Iran related to its nuclear program in exchange for new curbs on a program that the United States, Israel and others assessed was close to being able to produce fissile material for a nuclear weapon. Iran denies it sought nuclear weapons and says its program is entirely peaceful.

Under the accord, which took effect in January 2016, Iran ­curtailed its production of enriched uranium, sharply reduced its ­enriched-uranium stockpiles, agreed to strict monitoring of its nuclear facilities by a U.N. watchdog agency and curbed other activities that raised proliferation concerns. But it continues to produce nuclear fuel at low levels and operate a nuclear power plant.

Macron is betting that his personal bond with Trump and pragmatism about sharing the global security burden can help his case that the Iran deal is worth preserving. It is working to keep a cap on Tehran’s nuclear ambitions, Macron and other advocates argue, even if its terms do not cover missile development or alleged support for extremism and terrorism.

“We’ve come a long way, just the two of us, just in understanding, and we talked about Iran, we talked about Syria, we talked about a lot,” Trump said after his first meeting with Macron on Tuesday. “And we think we have solutions to a lot of them.”

On Wednesday, Macron will address a joint meeting of Congress, where he will have the chance to speak to skeptics of the nuclear accord in both parties, particularly Republicans eager for Trump to rip up the deal.

Trump and Macron’s day of meetings covered a range of topics and the French president noted that they discussed climate change and the U.S. withdrawal from the Paris climate accord, but he did not give details.

Trump’s expected upcoming meeting with North Korean leader Kim Jong Un was also on the agenda.

Trump described Kim as “very open and I think very honorable” in his dealings ahead of the planned summit. Kim, an absolute ruler whom the United States accuses of starving his people, is the same leader Trump has ridiculed as “Little Rocket Man.”

But Trump has greatly softened his tone ahead of the meeting, which has become the top item on his foreign policy agenda.

North Korea wants the meeting to take place “as soon as possible,” Trump said. It is expected in late May or early June.

“We think that’s a great thing for the world,” Trump said.