A day after flaunting his friendship with Donald Trump, French President Emmanuel Macron forcefully challenged many of the U.S. president's policies on Wednesday, urging the United States to engage more with the world, step up the fight against climate change and stay in the Iran nuclear pact for now.

Capping a three-day visit, Macron repeatedly criticized the president's isolationist principles in a speech to a joint meeting of Congress, an honor given to a small number of visiting foreign leaders.

Macron said U.S. involvement in the global community was vital and Trump's opposition to the Paris climate accord and international trade agreements was short-sighted.

The French president even took a dig at Trump's famous 2016 campaign slogan, calling for the United States to help "make our planet great again."

Macron has developed a strong relationship with Trump at a time when many European leaders are keeping a distance. During the visit, they repeatedly shook and grabbed hands, exchanged kisses on the cheek, and slapped each other's backs while praising their friendship.

But before Congress, Macron suggested he wanted more than just good optics.

Without mentioning Trump by name, he challenged the Republican president's protectionist and nationalist impulses and said modern economic and security challenges must be a shared global responsibility that is "based on a new breed of multilateralism."

"The United States is the one who invented this multilateralism. You are the one now who has to help preserve and reinvent it," Macron said.

IRAN DEAL

He said an international nuclear deal with Iran, which Trump has harshly criticized, was not perfect but must remain in place until a replacement is forged.

"It is true to say that this agreement may not address all concerns and very important concerns," Macron said. "But we should not abandon it without having something more substantial instead. That's my position."

Trump has often vowed to pull the United States out of the 2015 nuclear pact between Iran and six major powers. He will decide by May 12 whether to restore U.S. economic sanctions on Tehran, which could be a first step to ending the deal.

Macron, a centrist, also said he was confident the United States would eventually come back into the Paris climate accord aimed at combating global warming.

"Let us work together in order to make our planet great again," he said. "We are killing our planet - let us face it, there is no Planet B."

Macron's speech drew frequent cheers and applause, particularly from Democratic lawmakers when he took aim at Trump's views. Afterward, Democratic Senate leader Chuck Schumer said Macron's call for global engagement was timely.

"I hope that everyone at both ends of Pennsylvania Avenue takes President Macron’s words to heart," Schumer said on the Senate floor.

Trump had tweeted earlier on Wednesday that he was, "Looking forward to watching President Macron of France address a Joint Session of Congress today. This is a great honor and seldom allowed to be done...he will be GREAT!"

There was no immediate reaction from the White House afterward to Macron's speech.

Macron's visit also included efforts to convince Trump to exempt Europe from steel tariffs and convince the United States to maintain its military presence in Syria. France joined the United States and Britain in launching air strikes this month in retaliation for a chemical weapons attack blamed on Syrian President Bashar al-Assad.

But the Iran deal was the centerpiece of this week's talks.

The two leaders pledged to seek stronger measures to contain Iran but Trump made no commitments to stay in the nuclear deal, negotiated by former President Barack Obama. Trump also threatened Tehran with retaliation if it restarted its nuclear program.

Macron has sought a new approach that would see the United States and Europe agree to address any Iranian nuclear activity after 2025, tackle Iran's ballistic missile program and seek a political solution to contain Iran in Yemen, Syria, Iraq and Lebanon.

He said France remains committed to the bottom line goal of preventing Iran from developing nuclear weapons.

"Iran shall never possess any nuclear weapon. Not now not in five years, not in 10 years, never," he told lawmakers.

If Trump reaches an agreement on Iran with France and other European powers, Congress is expected to pass legislation to tweak it.

Lawmakers are widely expected, for example, to change the frequency with which Trump has to report to Congress that Iran is complying with the pact. They could also change some of the expiration dates in the agreement.

Macron is the eighth French president to address a joint meeting of Congress, and the first since Nicolas Sarkozy in 2007, House of Representatives Speaker Paul Ryan's office said. The last foreign leader to address a joint meeting was Indian Prime Minister Narendra Modi in 2016.

German Chancellor Angela Merkel faces difficult talks with Trump on Friday during a visit at a time when Washington and Berlin are at odds over a range of issues from trade to Iran.