Almost a year to the day since jaws hit the floor at the election of Donald Trump, many world leaders are still struggling to get a handle on the mercurial US commander in chief.

Not so Japanese Prime Minister Shinzo Abe, who has managed the Trump era better than just about any other leader around the world. It is no surprise, therefore, that Trump’s inaugural visit to Asia as president started with a three-day trip to Japan, where he will leave today for his next stop, South Korea. The two have been in close contact since before Trump even took office, and have reportedly spoken more than a dozen times, making Abe Trump’s point-man in Asia.

Abe’s deft handling of Trump has been all the more remarkable because he has done it in defiance of domestic antipathy. Just 24% of the Japanese public have confidence in Trump (down from 78% who had confidence in Barack Obama in his final year in office). But Abe has managed to develop strong ties with the US leader while achieving a thumping two-thirds super-majority in the Diet of Japan election just last month.

To understand the extent of Abe’s diplomatic achievement, consider Trump’s language towards Japan on the campaign trail in August 2016. “You know we have a treaty with Japan, where if Japan is attacked, we have to use the full force and might of the United States,” he said at a campaign event in Iowa. “If we’re attacked, Japan doesn’t have to do anything. They can sit home and watch Sony television, OK?”

Contrast that with the language on this current trip. “We like each other and our countries like each other,” Trump said on Sunday. “And I don’t think we’ve ever been closer to Japan than we are right now.”

So how has Abe managed to build such a close bond with Trump, and what can other leaders learn from it?

For starters, Abe has been willing to supplicate himself to the US president. Just nine days after Trump’s shock election, Abe paid him a visit in New York to push his case for a continued strong American presence in Japan and to establish a personal bond. In February Abe was back in the United States to meet the newly minted president on his turf. His gift to Trump on this latest visit? Trucker caps reading “Donald & Shinzo Make Alliance Even Greater.” Enough said.

Then there’s the personal connection. Abe treated his “marvelous friend” Trump to a round of golf in Tokyo on Sunday, before they joined their wives for dinner. Trump may see in Abe a kindred spirit, a person of a similar vintage (Trump is 71 to Abe’s 63) who has likewise framed his agenda as getting on with the job. Trump and Abe also fancy themselves as salesmen. Where other leaders may make Trump feel oafish, Abe gives him acceptance. Consider yesterday when the two leaders fed koi fish – Abe abandoned the delicate scooping of fish food into the pond to tip in the remainder, thereby giving Trump the green light to do the same.

But of course in politics interests ultimately prevail over friendships. That’s why Abe has managed to skilfully turn the escalating tensions in North Korea to his tactical advantage. Trump’s campaign comments indicate his doubts over the value of a strong US presence in Japan (it currently numbers 54,000 military personnel), so Abe needed to show why it was in the United States’ interests to keep them there. The threat of North Korea as a nuclear power made the case compelling. While it would have been apparent even without Abe’s positioning, his shoulder-to-shoulder stance with Trump in keeping Kim Jong-un in check has reinforced the message. Look, for contrast, at the testy relationship Trump has with South Korean President Moon Jae-in.

In areas where the United States and Japan disagree, Abe has managed to advance his interests without being gratuitous in the snub to Trump. Think about Japan’s leading role in reviving the Trans-Pacific Partnership without the United States. While clearly a defiance of Trump’s rejection of the pact, Abe has not engaged in sneering towards the Americans. Contrast that with the approach on climate change of French President Emmanuel Macron, who has overtly sought to kick sand in the face of the US leader for his withdrawal from the Paris agreement.

Not everything has gone smoothly in the relationship between Japan and the United States under their current leaders. Trump remains frustrated at the American trade deficit towards Japan, and has threatened to seek to rewrite the trade deal to boost US exports. But trade has taken a back seat to geopolitics, meaning the road hump that might derail a more fragile relationship has not done so in this case.

As the North Korea issue intensifies, the ties between Japan and the United States will be more important than ever. But even once North Korean tensions subside (if their resolution doesn’t blow us all to smithereens), look for the bond between Trump and Abe to stay strong on myriad other issues. Other leaders around the world might wish to take note of the tactics used by the wily Abe to get The Donald onside.