On his way to the Group of 20 summit in Japan, President Trump complained about all the countries in the group that take advantage of the United States. But once he arrived in Osaka, he appeared to set aside those concerns, using a rapid-fire series of meetings to flatter his fellow leaders and boast about improving ties.

He thanked Japan's Prime Minister Shinzo Abe for investing in auto plants in the U.S. He congratulated India's Narendra Modi on his landslide reelection as prime minister. And, he greeted German Chancellor Angela Merkel as "a fantastic person, a fantastic woman," adding, "I'm glad to have her as a friend."

The happy talk was a marked contrast to the grievances the president aired before the summit, when he tweeted that India must reduce tariffs on U.S. exports and groused about a decades-old defense pact with Japan.

"If Japan is attacked, we will fight World War III," Trump said during an interview with Fox Business Network before the summit. "But if we are attacked, Japan doesn't have to help us at all. They can watch on a Sony television."

In person, Trump was more conciliatory. With Abe, he spoke fondly of attending a sumo wrestling match during a state visit to Japan last month.

"That was a very special evening and something that everybody's talking about all over the world," the president said.

It's not unusual for Trump to adopt a hard line when discussing fellow leaders at a distance, only to make nice when they're face to face. The public show of courtesy doesn't defuse the real tensions around the G-20 table. It's still not clear, for example, whether Trump will sign on to a joint statement at the end of the summit, especially if it includes a strong warning against protectionism and the dangers of man-made climate change.

One of Trump's highest-profile meetings on Friday was with Russian President Vladimir Putin. It was the first time the two leaders had met since special counsel Robert Mueller concluded his investigation of Russian interference in the 2016 presidential election.

Trump has long advocated closer ties with Russia, and he told reporters during a photo op with Putin that "a lot of very positive things are going to come out of the relationship."

Pressed on whether he'll warn Putin about interfering in the 2020 election, Trump said, "Of course I will."

He then turned to Putin and said, "Don't meddle in the election," wagging his finger in mock sternness.

Copyright 2019 NPR. To see more, visit https://www.npr.org.