North Korea is “willing to have talks” with the United States, South Korea’s presidential Blue House said Sunday, as the PyeongChang Winter Olympics closed in a burst of fireworks and diplomacy.

President Moon Jae-in achieved his goal of using the Olympics as “peace games” to encourage both North Korea and the United States to ease off their threats, at least temporarily. 

During an hour-long meeting in PyeongChang on Sunday night, North Korea’s chief representatives at the Closing Ceremonies told Moon that Pyongyang was open to dialogue with Washington.

“The North agrees that ­inter-Korean relations and North Korea-U.S. relations should ­improve together,” the Blue House said in a statement after the meeting.

The statement did not make any mention of North Korea’s nuclear program or whether the dialogue would be about denuclearization. Pyongyang has previously insisted that its nuclear weapons are not up for discussion. The White House on Sunday took a wait-and-see stance.

Still, this is the first sign of willingness from North Korea in years, and it comes as the Trump administration has been signaling an openness to talk without preconditions.

Ivanka Trump, the president’s daughter and adviser, represented the United States at the closing event and sat in the same VIP box as North Korea’s lead delegate, Kim Yong Chol, who is under U.S. sanctions for his involvement in North Korea’s nuclear program. Gen. Vincent K. Brooks, the commander of U.S. forces in South Korea, who was in full military uniform, sat just two seats from Kim.

They watched, without speaking to one another, as the hosts put on an elaborate display ­involving K-pop stars, drones in tiger formations and skating pandas.

South Korean conservatives staged an overnight sit-in at a border crossing to try to prevent the North Korean official from entering the country. Kim is widely accused of masterminding two deadly attacks in 2010: a torpedo attack on the Cheonan naval corvette, which killed 46 South Korean sailors, and the shelling of an island, which killed four people.

But their efforts were stymied: The delegation crossed Sunday morning using a military road, attending the meeting with Moon and then the Closing Ceremonies.

Trump had no interaction with the North Korean delegation, a senior administration official said Sunday.

Speculation about secret talks mounted when Choe Kang Il, deputy director of the U.S. affairs division in North Korea’s Foreign Ministry, arrived with the group of traveling North Korean officials. 

Choe has taken part in talks with former U.S. officials in recent years, including at a security-related forum in Switzerland last September. There, he delivered a strong message: that North Korea’s nuclear weapons were not up for discussion.

His attendance surprised analysts, because his role has nothing to do with either sports or ­inter-Korean relations.

Meanwhile, traveling with Trump was Allison Hooker, the Korea director on the National Security Council and a key player in the White House’s policy on North Korea. Her name was not on the White House’s list for the delegation.

Some analysts said that a meeting between Hooker and Choe would be a good way to start easing the tensions that have risen over the past year, as North Korea has fired missiles and conducted a nuclear test, and the Trump administration has threatened military action in response.

“There is no reason for Allison Hooker to come, nor is there any reason for Choe Kang Il to be here,” said John Delury, a professor of international relations at Yonsei University in Seoul. “They’re both superfluous to the Olympic ceremonies and to ­inter-Korean relations.”

They would, however, be the right officials to meet and have a “preliminary discussion,” Delury said. “They could and they should do this.”

White House press secretary Sarah Huckabee Sanders, who is traveling in South Korea with Trump and Hooker, said before the Closing Ceremonies that no meetings were scheduled.

But afterward, in a statement released by the White House, she said the Trump administration “is committed to achieving the complete, verifiable, and irreversible denuclearization of the Korean Peninsula.”

She added: “There is a brighter path available for North Korea if it chooses denuclearization. We will see if Pyongyang’s message today, that it is willing to hold talks, represents the first steps along the path to denuclearization. In the meantime, the United States and the world must continue to make clear that North Korea’s nuclear and missile programs are a dead end.”

It emerged last week that Vice President Pence had planned to meet North Korean officials on the sidelines of the Opening Ceremonies, but the plan fell through at the last moment.

Before attending the Closing Ceremonies on Sunday, Trump met U.S. athletes who had competed in the Games. Lauren Gibbs, who won silver in women’s bobsled, offered to let Trump try on her medal and placed it around Trump’s neck. “That is so cool,” Trump said, joking that she didn’t want to give it back. 

Still, the whiff of a diplomatic way out of the tensions on the Korean Peninsula was a happy conclusion to the Games for the host country. 

The Winter Olympics started with North Korean leader Kim Jong Un sending his sister south to hand-deliver an invitation to Moon to visit Pyongyang for a summit. Moon said he would work to create the “right conditions.”

The question now is whether this nascent detente can be maintained. The United States and South Korea are scheduled to start joint military drills on April 1, an event that every year angers North Korea and causes an increase in tensions on the peninsula.

In closing the Games, Thomas Bach, the president of the International Olympic Committee, lauded the cooperation between the Koreas.

“With your joint march, you have shared your faith in a peaceful future for all of us,” he said. “Sport brings people together in a very fragile world.”

Athletes from the two Koreas had marched into the stadium wearing the same white uniform and under a unified Korean flag at the Opening Ceremonies. At the closing event, members of each team wore their national costume and waved all three flags — North, South and the unified peninsula logo. But they still walked together.

North Korea sent 22 athletes to the Games but did not win any medals.

Although recent efforts at persuading North Korea to relinquish its nuclear weapons have involved multilateral talks, the crux of the problem is between Pyongyang and Washington.

North Korea’s antagonism toward the outside world is rooted in its hatred of the United States, which all but destroyed the country with sustained bombing during the Korean War. That conflict ended in 1953 with an armistice — signed for the southern side by the United States, not South Korea. 

To this day, North Korea says that it needs nuclear weapons to fend off the United States and insists that any normalization will require a peace treaty with the United States, as the signatory to the armistice, not with South Korea.

In a reminder that any diplomatic gains will be hard-won — if they are won at all — North Korea on Sunday issued a tirade against the Trump administration over its announcement Friday of another wave of potentially crippling sanctions.

The administration blacklisted 56 vessels, shipping companies and other entities in an attempt to cut off North Korea’s ability to skirt existing sanctions targeting its nuclear program.

The “Trump group’s attempt itself to threaten us by such sanctions or wild remarks only reveals its ignorance about us,” a Foreign Ministry spokesman said Sunday, according to the North’s state-run Korean Central News Agency. “We came to possess nuclear weapons, the treasured sword of justice, in order to defend ourselves from such threats from the United States.” 

Any blockade would be considered an “act of war,” he said, and the United States would be to blame for any “catastrophic consequences” that resulted.