President Trump heartily shook hands with North Korean dictator Kim Jong-un on Tuesday, marking a historic first-time meeting between the leaders of the long-time adversaries.

Trump and Kim walked onto a red carpet in Singapore decorated with US and North Korean flags before smiling and greeting each other like old pals.

It was a far cry from the nearly 70 years of enmity between the two nations — including an eruption of tensions earlier this years, when Trump and Kim exchanged insults in the wake of provocative missile tests by the North.

“I feel really great. We’ll have a great discussion,” the president told reporters after he and Kim entered a meeting room where they sat across from one another at the Capella Hotel on Singapore’s lush resort island of Sentosa. “Tremendous success. This will be tremendously successful. It’s my honor. We will have a terrific relationship.”

Only late last month, Trump had cancelled the Singapore meeting after the North Korean government called Vice President Mike Pence a “political dummy” for a comment he made likening deposed Libyan despot Moammar Khadafy and Kim.

But Washington and Pyongyang got back on the same page and made Tuesday’s meeting happen.

“It’s my honor, and we will have a terrific relationship, I have no doubt,” Kim said through a translator. “Old prejudices and practices worked as obstacles on our way forward, but we’ve overcome all of them, and we are here today.”

Kim, who has routinely threatened to fire nukes on the United States, struck a remarkably conciliatory tone Tuesday.

“It was not an easy path here,” the North Korean tyrant said. “There’s a history of holding onto our ankles, and it appeared there were times that there were unfortunate practices where they were trying to block our eyes and our path, but we’ve overcome everything and come to this place.”

The closed-door meeting between Trump and Kim seemed impossible for decades. It was only months ago that the two leaders were firing barbs at one another — which some feared was a prelude to firing real missiles.

Trump mocked Kim as the “Little Rocket Man” while the North Korean despot labeled the president a “mentally deranged US dotard” in early January.

Shortly before Trump and Kim began their talks about a nuke-free Korean Peninsula, the president touted his diplomatic breakthrough in a tweet.

“The fact that I am having a meeting is a major loss for the U.S., say the haters & losers,” the president wrote. “We have our hostages, testing, research and all missle launches have stoped, and these pundits, who have called me wrong from the beginning, have nothing else they can say! We will be fine!”

The historic session came just days before Trump’s 72nd birthday on Thursday.

“Meetings between staffs and representatives are going well and quickly….but in the end, that doesn’t matter,” Trump tweeted a few hours before his encounter with Kim. “We will all know soon whether or not a real deal, unlike those of the past, can happen!”

The two leaders arrived in Singapore with scores of aides, bodyguards and diplomats in tow. But for the first part of their discussion they squared off face to face, with only a pair of translators, raising fears about the risks of conducting such a monumental meeting with no other witnesses.

After greeting each other for the first time at 9 a.m. Tuesday Singapore time — 9 p.m. New York time — in front of reporters, the president and the North Korean leader secluded themselves on Singapore’s Sentosa island for roughly 45 minutes while their entourages waited nearby.

Kim Jong Un and President Donald Trump meet, accompanied by their aides, Tuesday in Singapore. Reuters

The tête-à-tête was followed by a larger meeting and a working lunch attended by Trump’s Chief of Staff John Kelly, National Security Adviser John Bolton and Secretary of State Mike Pompeo, according to the White House, along with of their North Korean counterparts.

Word of the private sit-down drew critics on social media.

“Bad idea,” tweeted Paul Haenle, a former China director at the White House National Security Council in both the Obama and George W. Bush administrations. “I could see Trump giving up a lot for very little in return.”

Having aides present in high-stakes meetings — especially ones with adversaries like the dictator of North Korea — provides a president with some protection, ensuring there are staffers on hand to take accurate notes.

But there is established precedent for presidents meeting privately with foreign leaders — including foes — with only interpreters.

Former President Barack Obama, for example, was known to occasionally hold impromptu chats with leaders on the sidelines of major global summits, with only their translators at their sides.

Trump raised eyebrows early in his presidency when he met with Russia’s Vladimir Putin during a conference in Germany with only a Kremlin translator present.

At former President Ronald Reagan’s first meeting with then-Soviet leader Mikhail Gorbachev in Geneva, Switzerland, in November 1985, the two met alone with only trusted translators.

Only 15 minutes had been allotted for the discussion, but it went on for a full hour.

Political figures, including Democrats, wished Trump well in his quest for a workable nuclear deal with Kim.

“Good luck Mr President,” tweeted longtime Democratic Party operative and Clinton supporter Donna Brazile. “Many of us are praying for a successful meeting in #Singapore.”

Pompeo said the meeting could provide “an unprecedented opportunity to change the trajectory of our relationship and bring peace and prosperity” to North Korea.

The White House later said discussions with the North had moved “more quickly than expected” and that Trump would leave Singapore on Tuesday night after the summit, 15 hours earlier than planned.

Additional reporting by David K. Li and Wire Services

This report originally appeared on NYPost.com.