By Jeff Mason and Marine Pennetier
WASHINGTON (Reuters) - President Donald Trump and French President Emmanuel Macron pledged on Tuesday to seek stronger measures to contain Iran, as the U.S. leader considers whether to ditch an international accord meant to prevent Tehran from obtaining a nuclear weapon.
At a joint news conference after lengthy talks, Trump did not repeat threats to withdraw from the 2015 agreement with Iran which was negotiated by his predecessor, former President Barack Obama, but made clear he has little patience for staying in the deal.
Midway through a three-day state visit by Macron, the two leaders were remarkably chummy, repeatedly shaking hands and extolling each other's friendship.
The friendliness extended to their talks on Iran, Syria and trade but there was no indication of a breakthrough on Macron's bid to persuade Trump to keep the United States in the Iran nuclear deal, maintain U.S. troops in Syria and exempt European allies from 25-percent steel tariffs.
"It's not a mystery, we did not have the same starting positions, stances, and neither you nor I have a habit of changing our stances or going with the wind. That being said, I can say that we've had a very frank discussion," said Macron.
He said he and Trump had discussed "a new deal" that would address Iran's expansion in the Middle East and its ballistic missile program.
Trump must decide by May 12 whether to restore U.S. economic sanctions on Tehran, which would be a severe blow to the pact that Iran signed with China, France, Germany, Russia, Britain and the United States.
It was unclear whether Macron made substantial progress in his efforts to prevent Trump from pulling out of the deal.
Trump left the issue open on Tuesday, although a source familiar with the internal debate at the White House said one option was under discussion was giving Europe more time to toughen the Iran deal's terms.
Trump said he and Macron could have an agreement soon on the Iran accord. "We could have at least an agreement among ourselves very quickly. I think we're fairly close to understanding each other."
Trump threatened Iran with repercussions should it follow through with a vow to restart its nuclear program if the accord is scrapped.
"If Iran threatens us in any way, they will pay a price like few countries have ever paid," Trump said.
Trump and Macron repeatedly complimented each other and patted each other on the back during the French president's visit to the White House.
At one point Trump brushed dandruff from Macron's suit coat, saying: "We have to make him perfect -- he is perfect.”
Macron has forged an improbable bond with the volatile Trump, and hopes to leverage their friendship into progress on not only Iran but exempting Europe from steel tariffs, and protecting the 2016 Paris climate accord.
The two leaders also discussed European calls for exemptions from Trump's plan for 25 percent tariffs on steel imports. Trump said chronic trade deficits with U.S. allies around the world are "unacceptable."
Macron urged Trump to keep U.S. forces in Syria for the time being as a bulwark against Iran and to ensure the defeat of Islamic State militants.
Trump did not promise to leave the troops in Syria but made clear they would not be withdrawn imminently.
"We want to come home. We'll be coming home. But we want to leave a strong and lasting footprint," Trump said.
Under the nuclear deal, Iran agreed to curb its nuclear ambitions in return for the lifting of economic sanctions. Tehran says its nuclear program is only for peaceful means.
Iran has said it will ramp up its nuclear program if the deal collapses and a senior Iranian official said on Tuesday that Tehran might quit a treaty designed to stop the spread of nuclear weapons if Trump scraps the agreement.
Trump called the Iran agreement a "terrible deal" that was "insane" and "ridiculous" because it did not deal with ballistic missiles or Iran's involvement in conflicts such as those in Yemen or Syria.
A U.S. withdrawal from the Iran agreement would raise tensions in an already volatile region, possibly prompting an arms race involving Saudi Arabia.
Pulling out of the Iran agreement would also raise questions over how Trump could coerce North Korea into giving up its nuclear weapons. Trump is trying to arrange a summit with North Korean leader Kim Jong Un in late May or early June.
On Tuesday evening, the Trumps are to host the Macrons at the first state dinner conducted by Trump since he took power in January, 2017. Macron's visit will be followed by one on Friday from German Chancellor Angela Merkel.
(Writing by Steve Holland; Additional reporting by Doina Chiacu, Makini Brice and Roberta Rampton; Editing by Alistair Bell)