by Mark Landler

PALM BEACH, Fla. — President Donald Trump declared Wednesday that he would scrap a planned summit meeting with North Korea’s leader, Kim Jong Un, or even walk out of the session while it was underway, if his diplomatic overture was not heading toward success.

Trump continued to express optimism — verging on eagerness — about sitting down with the North’s reclusive leader. But as the momentum for a meeting grows in both Washington and East Asia, the president acknowledged that it was a perilous undertaking that could still end in failure.

“If I think that it’s a meeting that is not going to be fruitful, we’re not going to go,” Trump said at a news conference at his Mar-a-Lago estate in Florida, standing alongside Prime Minister Shinzo Abe of Japan. “If the meeting, when I’m there, is not fruitful, I will respectfully leave the meeting.”

Trump’s words reinforced his decision to send CIA Director Mike Pompeo on a secret trip to meet Kim. Pompeo, nominated by Trump last month as secretary of state, played advance man for the president in Pyongyang, laying the groundwork for the planned meeting.

Among the potential hurdles for the gathering, Trump said, were three U.S. citizens detained in North Korea. The president said that the United States was “fighting very diligently” to obtain their release and that there was a chance of positive developments.

Still, Trump conspicuously declined to make their release a precondition of his meeting with Kim. He also did not demand any new concessions from North Korea beforehand, underscoring how determined he is to make history by convening with the leader of a country he threatened with war a few months ago.

In preparing for the planned event, Trump’s decision to dispatch his CIA director reflected the president’s trust in and comfort with Pompeo, as well as how diplomats were sidelined in brokering what could be a landmark encounter.

“Meeting went very smoothly and a good relationship was formed,” Trump said in an early morning Twitter post before he went golfing with Abe. “Details of Summit are being worked out now. Denuclearization will be a great thing for World, but also for North Korea!”

Pompeo is still awaiting confirmation to his new post, and faces a challenging vote in the Senate Foreign Relations Committee, where several Democrats have come out against him. The White House and Republicans seized on Pompeo’s trip as another reason for the Senate to confirm him, while Democrats said he had misled them by failing to disclose his mission, even in private conversations.

But the visit underlines the confidence that Trump has developed in Pompeo, a former Tea Party congressman who has emerged as one of the president’s closest advisers — a stark contrast to Rex W. Tillerson, whom Trump fired as secretary of state days after accepting Kim’s invitation to meet.

It also underlines Trump’s unorthodox approach to one of the riskiest diplomatic gambits of his presidency. However trusted by the president, Pompeo is hardly a traditional emissary. He is not yet the nation’s chief diplomat but a lame duck as the nation’s spymaster.

Pompeo met with Kim on Easter Sunday, a senior official said, bringing along several aides from the CIA — but nobody from the State Department or the White House.

Some former administration officials expressed surprise that he returned from Pyongyang with no visible concessions, like the release of the three Americans detained in North Korea. Pompeo raised the issue, another official said, adding that the White House would continue to push for their release.

In 2014, James R. Clapper, then the director of national intelligence, traveled secretly to North Korea to negotiate the release of two Americans, Kenneth Bae and Matthew Todd Miller. Three Korean-Americans — Kim Dong-chul, Kim Sang-duk and Kim Hak-song — are currently being held on charges of espionage and committing hostile acts toward the North Korean state.

The administration also has not agreed on a date for the meeting between Trump and Kim, which officials said pointed to problems in settling on a site for the encounter. On Tuesday, Trump told reporters that the White House was looking at five potential locations.

The White House has begun narrowing the list of options, a senior official said, eliminating sites like Pyongyang and the Demilitarized Zone between North and South Korea, which could pose an optics problem for Trump. Meeting somewhere in the United States remains a possibility, though that could raise similar issues for Kim.

The administration is studying several third countries — Singapore and Vietnam, in Asia; Sweden and Switzerland, in Europe — though all are far from North Korea, posing a challenge to Kim’s fleet of rickety aircraft. Mongolia, which is closer to the North, is a long shot, the official said.

Without a site, however, the White House has been unable to announce a date, though officials are sticking to Trump’s recent declaration that the meeting will be in late May or early June.

On Tuesday, Trump added to the mystery surrounding the visit by appearing to confirm that he had been in direct contact with Kim himself. He later clarified that while the talks were at “the highest levels,” he would “leave it a little bit short of that.”

Pompeo’s involvement with North Korea predated Trump’s decision to meet Kim, several officials said. He has been dealing with North Korean representatives through a channel that runs between the CIA and its North Korean counterpart, the Reconnaissance General Bureau.

He also has been in close touch with the director of South Korea’s National Intelligence Service, Suh Hoon, who U.S. officials said brokered Kim’s invitation to Trump.

While a meeting between the leaders would be one of the boldest diplomatic gambles in recent years, it was orchestrated largely by the intelligence services of the three countries.

Officials said Suh laid the groundwork for Kim’s invitation in negotiations and a subsequent meeting in Pyongyang with Kim Yong Chol, a powerful general who leads inter-Korean relations and used to run North Korea’s intelligence service.

Suh was one of two South Korean envoys who visited the White House to brief Trump on their meeting with Kim Jong Un in Pyongyang — which led to the president’s impromptu decision to accept Kim’s invitation.

For Pompeo, who now has an office at the State Department, the choice to use the intelligence channel was mostly a convenience — allowing him to be involved in the planning as he awaited his move to the department.

Still, some officials expressed concern that the CIA had taken the lead in orchestrating a leader-to-leader meeting — work that would normally fall to the State Department. The intelligence officials on the North Korean side, they said, are shadowy figures, not least Kim Yong Chol himself, who is accused of masterminding a torpedo attack that sank a South Korean navy ship in 2010, killing 46 sailors.

The State Department’s role in North Korea dwindled after Trump publicly split with Tillerson over his efforts to open a diplomatic channel to the North, initially to obtain the release of the three Americans but also to set the stage for a broader negotiation.

In October, while Tillerson was in Beijing, Trump tweeted, “I told Rex Tillerson, our wonderful Secretary of State, that he is wasting his time trying to negotiate with Little Rocket Man...”

The State Department recently lost its chief North Korea negotiator, Joseph Yun, who retired from the Foreign Service, in part because of his frustration with his agency’s diminished role.