BIARRITZ, France—President Trump clashed with world leaders over the U.S. trade war with China and a host of foreign-policy issues at a Group of Seven summit that showed his isolation on the world stage.

A weekend of meetings at this sea resort included an unexpected visit by Iranian Foreign Minister Javad Zarif at France’s invitation that caught some U.S. officials off guard.

Mr. Zarif, who was sanctioned by the U.S. last month, met with French President Emmanuel Macron and other French officials and briefed the U.K. and German delegations. Hours later, he left Biarritz without meeting U.S. officials.

Throughout the summit, attempts at bonhomie—Mr. Trump kissed German Chancellor Angela Merkel on both cheeks—gave way to tensions. G-7 leaders tried to squeeze concessions from Mr. Trump on Iran and other issues over closed-door meals, beyond the reach of White House advisers and TV cameras.

But Mr. Trump responded by doubling down on his policies and offering accounts of group meetings that conflicted with other countries’ descriptions. He reaffirmed his commitment to a trade war with China and asserted his right to declare a national emergency over the matter; contradicted other leaders and his own administration over whether a decision had been made to invite Russia to next year’s gathering; disputed French officials who said the leaders had reached a consensus over how to deal with Iran; and broke with Japan over whether recent missile tests by North Korea constituted a violation of agreements.