SEOUL, South Korea — North Korea canceled high-level talks with South Korea on Wednesday and threatened to walk away from a historic summit with President Donald Trump to protest ongoing military exercises involving the U.S.

The surprise move, which was announced by North Korean state media and confirmed by Seoul, came just hours before a planned North-South meeting at a border village.

It would have been the latest step in the thaw between two neighbors that officially remain at war.

North Korea's state-run Korean Central News Agency also warned the U.S. that the "provocative military racket" put the June 12 summit between Trump and Kim Jong Un in jeopardy.

The North said it was angry about a large military exercise called Max Thunder that's currently being staged by Washington and Seoul in South Korea. KCNA called the drills an "undisguised challenge" and a "deliberate military provocation" against the apparent strides toward peace.

Secretary of State Mike Pompeo poses with North Korean leader Kim Jong Un on May 10. KCNA / AP

Later, North Korea's first vice minister of the Ministry of Foreign Affairs was quoted by the news agency as saying Pyongyang could walk away from the summit with the U.S.

"If [the Trump administration] only pushes us into a corner and forces us to give up our nuclear weapons unilaterally, then we will no longer take interest in such a talk and would have to reconsider," Kim Kye Gwan said.

Baek Tae-hyun, a spokesman for South Korea's Unification Ministry, confirmed that North Korea had canceled Wednesday's talks with the South.

Baek said at a briefing for reporters that Seoul "is urging North Korea to come to the talks soon for the sake of peace and prosperity on the Korean Peninsula."

During a brief exchange with reporters at the White House Wednesday, Trump offered no insights into the broader meaning of the cancellation or whether Kim might be bluffing.

"We haven't heard anything," Trump said. "We'll see what happens."

Kim's regime alleges that the Max Thunder drills between the South Korean and U.S. air forces are a rehearsal for an invasion of the North and a provocative move amid signs of improving ties between the two countries.

A South Korean military official told NBC News that the drills would go on as planned.

Some of the earliest reports of the move were carried by the South Korean news agency, Yonhap.

White House Press Secretary Sarah Huckabee Sanders said the Trump administration was aware of the reports.

"The United States will look at what North Korea has said independently, and continue to coordinate closely with our allies," she said in a statement.

State Department spokeswoman Heather Nauert told reporters on Tuesday afternoon that the United States would "continue to go ahead and plan the meeting" between Trump and Kim.

Kim has said previously that he understood the "need and the utility of the U.S. and [South Korea] continuing in its joint exercises," Nauert said, stressing that the exercises are legal and "planned well, well in advance."

The Defense Department also defended the exercises in a statement, calling them "defensive" and part of the alliance's "routine, annual training program to maintain a foundation of military readiness."

The two-week exercise kicked off Friday. It involves 100 warplanes, including eight F-22 radar-evading fighters and an unspecified number of B-52 bombers and F-15K jets, Yonhap reported.

Stella Kim reported from Seoul, Daniel Arkin from New York, Hans Nichols from Washington, and Alex Johnson from Los Angeles.