North Korea’s authoritarian leader may have found the key to President Trump’s heart: a flowery letter full of flattery.

In May, when Trump threatened to cancel his upcoming summit with Kim Jong Un because of the “open hostility” being expressed by the North Korean leader, Kim got out his stationery.

Trump liked what he read, and the summit was back on for June 12.

“That letter was a very nice letter,” Trump told reporters on June 1. “Oh, would you like to see what was in that letter? Would you like it?” he teased.

Trump then received a letter from Kim on Aug. 1 that prompted the president to reply publicly on Twitter.

“Thank you for your nice letter — l look forward to seeing you soon!” Trump wrote.

Love again was in the air, or at least nestled in Trump’s coat pocket, last week at the United Nations.

Trump carried the latest missive from Kim with him to meetings with world leaders, at one point pulling it, still folded, from his suit jacket and fingering it as he spoke to reporters while seated next to Japanese Prime Minister Shinzo Abe.

“We have a very good relationship. He likes me. I like him. We get along,” Trump told reporters at the end of his trip to the United Nations, calling the latest correspondence “a beautiful piece of art.”

The White House has kept the exact contents of the letters a secret, but people briefed on them said they did not contain substantive new policy proposals or other breakthroughs.

Nonetheless, they have had their desired effect: charming Trump.

“We are doing great,” Trump told supporters at a rally in Wheeling, W.Va., on Saturday night, rhapsodizing about his relationship with Kim. “I was really being tough, and so was he, and we’d go back and forth. And then we fell in love. Okay? No, really. He wrote me beautiful letters, and they’re great letters. We fell in love.”

North Korean rhetoric tends to be over the top in both praise and disdain — last year the regime called Trump a “mentally deranged U.S. dotard” — and formal written communication can be particularly hyperbolic, veterans of past negotiations and other North Korea watchers said. They warned that Trump would be wise to focus on what Kim does rather than what he writes in a letter.

“What’s probably attracting the president is rhetoric that for people who have done this for a long time is very familiar and is meant to convince fellow travelers, such as, ‘I am completely committed to the denuclearization of the Korean Peninsula,’ ” said one person familiar with aspects of the current negotiating effort led by Secretary of State Mike Pompeo who was not authorized to speak on the record.

Trump has based much of his foreign policy on the belief that he is a master negotiator who can strike deals where his predecessors failed. He often publicly muses about whether foreign leaders, such as Chinese President Xi Jinping, like him as a barometer of what types of deals may be possible. But analysts said this approach comes with its own set of perils.

“Historians and practitioners sometimes refer to this as the ‘perils of personal diplomacy’ — the notion that leaders can get carried away by emotion when they’re dealing with other leaders directly,” said Jon Meacham, the presidential historian and author. “Politicians are wired to like and to be liked, which means the closed atmospherics of a summit or a correspondence can overwhelm considerations of national interest.”

British Prime Minister Neville Chamberlain and Adolf Hitler come to mind, Meacham added.

“In Trump’s case, the worry, to put it mildly, is that he’s overly susceptible to flattery,” he said.

Trump’s public affection for Kim has no modern parallel, said Meena Bose, director of the Kalikow Center for the Study of the American Presidency at Hofstra University.

President Harry S. Truman called Joseph Stalin “someone I could work with,” which sounds tame by comparison, Bose said, and George W. Bush was mocked for saying he had looked into Vladi­mir Putin’s eyes and seen the Russian leader’s soul.

“It’s not unprecedented for presidents to make personal remarks about other leaders,” she said. “The ‘love him’ is, of course, particularly enthusiastic.”

Trump shocked allies, his own party and the foreign policy establishment by agreeing to the unprecedented personal meeting with Kim in June.

Trump had spent his first year in office warning Kim that he risked destruction if he threatened the United States with North Korea’s newly capable intercontinental ballistic missiles. He famously insulted the short, heavyset North Korean leader as “Little Rocket Man.” It was not a term of endearment.

Now that they are close, Trump has dropped the snide references to Kim, instead praising his savvy and his “incredible” commitment to negotiations.

“We’ve come a long way from, you know the term,” Trump said in Wheeling, in apparent reference to “Rocket Man.”

The summit in Singapore, which featured the two leaders holding hands, resulted in the return of some remains of U.S. service members killed in the Korean War but little other measurable success.

North Korean officials have been vague about what an agreement over its nuclear weapons would cover and have resisted a deadline, current and former U.S. officials said.

Addressing reporters at the United Nations last Wednesday, Trump stressed his personal connection with Kim and said he sees no need to “rush” an agreement with North Korea to dismantle its nuclear program.

The process could take as many as three years, Trump added, contradicting top advisers.

“We’re not playing the time game,” Trump said. “If it takes two years, three years or five months, it doesn’t matter.”

Pompeo plans to visit Pyongyang next week to prepare for the second summit between Trump and Kim.

Trump’s chumminess with Kim makes traditional U.S. allies in the Pacific nervous — particularly Japan, which is directly threatened by North Korea’s nuclear arsenal.

Abe had presented Trump a list of specific things he did not want Trump and Kim to agree to, using an invitation to Trump’s Florida golf resort weeks before the summit to lobby the president, a person familiar with the meeting said.

Trump, however, told Abe that he needed to enter the meeting unencumbered “and look in his eyes and see if we have a deal,” the person said, speaking on the condition of anonymity to protect diplomatic discussions.

U.S. sanctions on North Korea remain in place and probably would be lifted in stages if North Korea sticks to a future agreement for verification and dismantlement of its nuclear facilities. Such a detailed agreement appears a long way off, and U.S. officials are wary of North Korea’s long history of obfuscation, cheating and delay.

North Korea warned Tuesday that a formal end to the Korean War should not be considered a bargaining chip in negotiations over North Korean nuclear weapons, but it dangled the possibility of concessions in exchange for the lifting of sanctions.

At the United Nations last week, North Korean foreign minister Ri Yong Ho said Washington has not demonstrated commitment to improving relations, adding that North Korea will not “unilaterally” disarm if it cannot trust the United States. Many observers took as a threat that Washington should lift sanctions or risk talks falling apart.

“We are at a point now where both the U.S. and North Korea have bought into this top-down, leader-driven process,” said Jenny Town, a research analyst at the Stimson Center and editor of the North Korea-focused publication “38 North.”

“So whenever there are kind of grievances on the working level, instead of working on that, both sides are escalating higher,” Town said.

The “love” comment on Saturday night occasioned comparisons to Trump’s criticism of former president Barack Obama as weak and overly eager to strike a deal with Iran over its alleged nuclear weapons ambitions.

“We would have been dragged up to the Congress and flailed in public” had Obama ever said the same thing about a dictator who threatened the United States, said Kelly Magsamen, a senior Asia policy official at the Pentagon in the Obama administration.

Trump’s faith in his personal relationship with Kim seems to ignore the history of failed negotiations with North Korea and the caution of some aides.

Trump is in a classic bad relationship, Magsamen said.

“Highly dysfunctional on both sides. An abusive partner who has a history of cheating,” Magsamen deadpanned.

Her relationship advice?

“Get a prenup.”