The U.S. delegation delivers to North Korean Foreign Minister Ri Yong Ho a letter from President Trump to Kim Jong Un. (U.S. Department of State)

Diplomats from the United States and North Korea alternately shook hands and lobbed critiques at one another Saturday, in what appeared to be another roadblock in the path to negotiations aimed at ending Pyongyang’s nuclear and missile programs.

In a day of head-snapping twists of tone at the annual conference of the Association of Southeast Asian Nations (ASEAN) in Singapore, Secretary of State Mike Pompeo warned Russia not to help North Korea cheat on U.N. sanctions that Moscow had voted for.

Then, just a few short hours later, Pompeo and North Korean Foreign Minister Ri Yong Ho approached each other for a public handshake and exchanged promising pleasantries with big smiles. According to State Department spokeswoman Heather Nauert, Pompeo suggested they would talk soon, and Ri agreed, adding, “There are many productive conversations to be had.”

Nauert said that beyond the brief exchange at the group photo, Pompeo and Ri did not have a more formal meeting. Given where the United States and North Korea were a year ago, Nauert said, “This is a step in the right direction.”

As the two top diplomats returned to their seats, Sung Kim, the U.S. ambassador to the Philippines, approached Ri and handed him a white envelope bearing a letter from President Trump to North Korean leader Kim Jong Un.

While the full contents were unknown, Pompeo tweeted later Saturday that the letter was Trump’s reply to a missive the president received from Kim last week, which White House spokeswoman Sarah Huckabee Saunders characterized as a “follow-up” to their June summit in Singapore. In his own tweet, Trump described Kim’s letter as “nice,” breezily adding, “I look forward to seeing you soon!”

But things at the Singapore conference went downhill after Pompeo departed for Indonesia: Ri waited until then to deliver a sharp attack on the United States in remarks at the forum.

Though he said the North Korean government remains committed to a joint statement that followed a summit between Trump and Kim in June, Ri criticized the White House for insisting on maintaining sanctions until disarmament is complete and demanded “confidence-building” measures along the way.

“What is alarming, however, is the insistent moves manifested within the U.S. to go back to the old, far from its leader’s intention,” Ri said.

The divergent rhetoric underscored the difficulties that have hampered previous attempts to persuade North Korea to abandon its nuclear and missile programs. It also was reminiscent of Pompeo’s last visit to North Korea in July, when he declared the meetings “productive” but North Korea hours later would say the U.S. approach was “gangster-like.”

Previous negotiators have seen similar rapid-fire mood swings from Pyongyang. This is just North Korea’s style of negotiating and indicates any talks would probably take many months, if not years.

Pompeo has acknowledged talks will be difficult and drawn out, but he said Saturday that he remains optimistic that eventually the two sides can reach a deal to end the North’s nuclear weapons program.

Pyongyang’s willingness to truly denuclearize has come into question lately. A confidential report by the United Nations, shown to reporters Friday, says North Korea has violated numerous U.N. Security Council sanctions by continuing to develop its nuclear weapons and missile programs. Also last week came news reports that intelligence agencies believe the North is developing new missiles.

Much of the discord stems from differences in how Washington and Pyongyang view the pace of rewards to North Korea if it proceeds dismantling its weapons programs. Pompeo has insisted that the United States expects total denuclearization and that sanctions will remain in place until the process is complete. North Korea, officially named the Democratic People’s Republic of Korea (DPRK), has demanded a phased approach, with sanctions eased in several steps as a show of goodwill.

“Confidence is not a sentiment to be cultivated overnight,” Ri said in his remarks after Pompeo’s departure. “In order to build full confidence between the DPRK and the U.S., it is essential for both sides to take simultaneous actions and phased steps to do what is possible one after another.”

Ri added: “Only when the U.S. ensures that we feel comfortable with and come close to it will we be able to open our minds to the U.S. and show it in action.”

An administration official brushed off the remarks as growing pains in a still-developing relationship that has been wobbly at times.

“This is to be expected,” said the official, speaking on the condition of anonymity to discuss the criticism frankly. “We’re building a relationship with North Korea after years of difficult relations.”

Pompeo used the ASEAN conference to hold meetings with diplomats from more than two dozen countries to urge their governments to keep up the economic pressure on Pyongyang until its nuclear weapons program is irreversibly dismantled.

At a news conference, Pompeo noted reports that Russia was entering into joint ventures with companies in the North and granted new work permits to North Korean guest workers. He said the United States considers the reports, first published in the Wall Street Journal, to be accurate and as such would violate a U.N. Security Council resolution restricting trade with North Korea.

“I want to remind every nation that has supported these resolutions that this is a serious issue and something that we will discuss with Moscow,” he said.

“We expect the Russians and all countries to abide by the U.N. Security Council resolutions and enforce sanctions on North Korea. Any violation that detracts from the world’s goal of finally, fully denuclearizing North Korea would be something that America would take very seriously.”

Despite the carping, the tone was considered a major improvement over last year, when the buzz of the ASEAN meeting was whether Pompeo’s predecessor, Rex Tillerson, would even be in the same room with North Korea’s foreign minister.

This year, in his first visit as secretary of state, Pompeo has been at the forefront of talks with North Korea aimed at its eventual denuclearization.

“From my meetings here, the world is united in seeing this achieved,” Pompeo told reporters. “There has not been single country that hasn’t thanked the United States for its efforts in moving the world toward the possibility of achieving this. . . . I’m optimistic that we will get this done in the timeline, and the world will celebrate what the U.N. Security Council has demanded.”

That view seemed to be supported by a communique expected from the ASEAN diplomats, who, along with representatives of Japan and South Korea, urged Washington and Pyongyang to “continue working towards the realization of lasting peace and stability on a denuclearized Korean Peninsula,” according to a draft seen by the Associated Press.

Earlier Saturday, Pompeo suggested that the timeline for denuclearization will be determined in large part by North Korea’s mercurial leader.

“The ultimate timeline for denuclearization will be set by Chairman Kim, at least in part,” he said in an interview with Channel NewsAsia. “The decision is his. He made a commitment, and we’re very hopeful that over the coming weeks and months we can make substantial progress towards that and put the North Korean people on a trajectory towards a brighter future very quickly.”

Pompeo started the morning with a rosy tweet, saying he had had productive discussions on North Korea with Chinese Foreign Minister Wang Yi. China is responsible for the lion’s share of trade across North Korea’s border.

“Our cooperation,” he tweeted, “. . . sends a strong signal to the region that, despite differences, #China and the US can work together to get important work done.”

Despite the United States’ growing trade war with China, there was a palpable sense of relief that the tensions of last year appeared to have eased considerably.

The Southeast Asian region is “quite happy to see how the events on the Korean Peninsula are turning out, especially compared to last year, which was a really worrying time,” said Dino Patti Djalal, a former Indonesian ambassador to the United States who led a delegation to Pyongyang for informal talks. “There was a real threat of clashes and talk of preemptive strikes.”

Things are “exceptionally much better” now, he added, and the region “welcomes this development and thinks the momentum should be kept.”

Apart from urging continued support for being tough on Pyongyang, Pompeo’s three-day trip to Asia is part of a U.S. effort to boost trade ties with the region, despite the Trump administration’s withdrawal from the Trans-Pacific Partnership trade agreement.

Pompeo pledged on Saturday to provide nearly $300 million in new security funding for Southeast Asia. He said it would be used to strengthen maritime security, develop humanitarian assistance and peacekeeping capabilities, and counter “transnational threats.”

On Monday, Pompeo said the United States would invest $113 million in technology, energy and infrastructure initiatives in the region as part of what he characterized as “a down payment on a new era of U.S. economic commitment to the region.”