President Donald Trump on Thursday canceled the planned summit with North Korean leader Kim Jong Un, which was set to take place June 12 in Singapore, and said the American military is prepared to act if there's any fallout.

Trump said the military "is ready if necessary" to respond to any provocation by North Korea in the wake of the cancellation.

"I've spoken to (Defense Secretary) General Mattis and the Joint Chiefs of Staff and our military, which is by far the most powerful anywhere in the world that has been greatly enhanced recently, as you all know, is ready if necessary," he said.

Trump also said he has consulted with allies Japan and South Korea, which he said are both prepared should Kim commit a "reckless or foolish act." Trump called the cancellation a “tremendous setback” for peace and denuclearization of the Korean peninsula.

Earlier, in a letter addressed to Kim and released earlier by the White House, Trump blamed the cancellation on the "tremendous anger and open hostility" in a recent statement by the North Koreans.

"I feel it is inappropriate, at this time, to have this long-planned meeting," he wrote.

"Therefore, please let this letter serve to represent that the Singapore summit, for the good of both parties, but to the detriment of the world, will not take place. You talk about you nuclear capabilities, but ours are so massive and powerful that I pray to God they will never be used," the president added.

The president appeared to be referring to a statement by North Korea on Thursday that warned of a "nuclear-to-nuclear showdown" with the United States.

North Korean leader Kim Jong Un at a meeting of the Central Military Commission. KCNA via AP

The North Koreans were reacting to comments by Vice President Mike Pence this week suggesting that North Korea could face a fate similar to that of Libya, where the leader, Muammar Qaddafi, was deposed and killed and the country fell into chaos. North Korea called the vice president a "political dummy" for the remark.

A senior White House official told NBC News that it was the nuclear threat and not the disparaging statement about Pence that prompted the administration to scrap the meeting.

"The summit would have never been able to work under these circumstances," the official told NBC News.

However, during his White House remarks, Trump suggested that the summit could still take place in the future.

"If and when Kim Jong Un chooses to engage in constructive dialogue actions, I am waiting," the president said. "In the meantime, our very strong sanctions — buy far strongest sanctions ever imposed — and maximum pressure campaign will continue."

"Nobody should be anxious, we have to get it right," Trump said.

White House

North Korea’s vice foreign minister said in a statement published by the state-run Korean Central News Agency that the country is “open to resolving problems at any time in any way,” according to Reuters.

“We had set in high regards President Trump's efforts, unprecedented by any other president, to create a historic North Korea-U.S. summit," said Kim Kye Gwan. “We tell the United States once more that we are open to resolving problems at any time in any way."

The announcement of the cancellation also came shortly after North Korea was said to have destroyed a nuclear test site.

A U.S. intelligence official told NBC News that while that was a potentially important gesture on North Korea's part, it also may be reversible.

On Tuesday, Trump suggested there was a "substantial chance" that summit wouldn't happen in June. "If it doesn't happen, maybe it will happen later," Trump said in Oval Office remarks alongside South Korean President Moon Jae-in.

North Korea had also canceled high-level talks with South Korea this month.

Moon expressed regret about the cancellation and urged direct talks between Trump and Kim to salvage negotiations regarding denuclearization of the Korean Peninsula.

"Denuclearization and the lasting peace on the Korean peninsula cannot be abandoned or delayed as they are the historical assignment," Moon, who convened an emergency national security council meeting, said in a statement. "The sincerity of the affected parties who have been working to resolve the problem has not changed."

He added, "It is hard to resolve sensitive and difficult diplomatic issues with the current way of communications. (We) hope that the leaders resolve problems through direct and close dialogue."

On Capitol Hill, Republicans embraced Trump's decision to pull out, while Democrats said the president got played.

"Kim Jun Un, in the words of a wise man 'Congratulations, you just played yourself.' Withdrawing from talks with #NKorea is 100% the right decision. #KJU doesn’t want a deal. He has deliberately sabotaged the talks over the last two weeks & was setting us up to take the blame," Sen. Marco Rubio of Florida tweeted.

House Speaker Paul Ryan of Wisconsin said: "The North Korean regime has long given ample reason to question its commitment to stability. We must continue to work with our allies toward a peaceful resolution, but that will require a much greater degree of seriousness from the Kim regime."

He added, "At the same time, Congress has provided significant tools to hold North Korea accountable, and it is important that the United States not relent in this maximum pressure campaign."

Sen. Tom Cotton of Arkansas said, "North Korea has a long history of demanding concessions merely to negotiate. While past administrations of both parties have fallen for this ruse, I commend the president for seeing through Kim Jong Un's fraud."

However, Democrats expressed concern about the announcement.

House Minority Leader Nancy Pelosi, D-Calif., said, "Kim Jong Un is the big winner."

"It’s kind of like a Valentine to Kim Jong Un," she said of Trump's cancellation letter. "Here you have a thug, a person who has killed his own family members, a person who runs a police state, being legitimized by the President of the United States...And when he got this letter from the president saying, 'Okay, never mind,' he must be having a giggle fit right there now in North Korea."

Sen. Bob Menendez of New Jersey, the ranking member of the Senate Foreign Relations Committee, criticized the administration for an alleged lack of preparation for the now-canceled summit.

"The art of diplomacy is a lot harder than the art of the deal," Menendez said. "Kim Jong Un already received some of what he wanted, a recognition that he could actually be seen as reasonable, and it's amazing to me that the administration is somehow shocked that the North Koreans are acting as North Korea acts."