President Donald Trump on Thursday said talks with North Korean leader Kim Jong Un in Vietnam fell through because Kim demanded total sanctions relief but wouldn't give up enough nuclear sites.

"They were willing to de-nuke a large portion of the areas we wanted, but we couldn't give up all the sanctions for that," Trump said.

Trump and Kim discussed shutting down Yongbyon, the centerpiece of North Korea's nuclear program, but Trump said it wasn't enough.

The leaders were due to sign a treaty in Hanoi, Vietnam, on Thursday, but the ceremony was abruptly canceled after talks broke down.

The Nuclear Threat Initiative has identified about 12 North Korean nuclear sites.

President Donald Trump says his summit with North Korean leader Kim Jong Un collapsed Thursday because Kim demanded a total reversal of sanctions but did not offer to close enough nuclear sites in return.

Trump told a news conference in Hanoi, Vietnam, that Kim "wanted the sanctions lifted in their entirety and we couldn't do that."

Trump and Kim during a meeting at the Sofitel Legend Metropole hotel in Hanoi on Thursday. SAUL LOEB/AFP/Getty Images

"They were willing to give us areas but not the ones we wanted," he said.

Trump said that the two leaders discussed North Korea's main nuclear facility, Yongbyon, and that Kim said he was willing to shut it down.

Trump at a news conference in Hanoi on Thursday. MANAN VATSYAYANA/AFP/Getty Images

Read more: Trump attacks 'terrible' Congress for holding embarrassing Cohen hearing in the middle of his failed North Korea summit

Trump did say Kim had promised North Korea would continue to hold off testing missiles.

"Mr. Kim said the testing will not start, on rockets, missiles — all I can tell you is that's what he said," Trump said.

Kim and Trump in Hanoi. KOREA SUMMIT PRESS POOL,MANDEL NGAN/AFP/Getty Images

"Sometimes you have to walk and this was one of those times," he added.

A "Joint Agreement Signing Ceremony" that appeared on an earlier White House schedule was abandoned as talks collapsed. After the news conference, Trump went straight to the airport and flew away in Air Force One.

"We haven't given up anything and frankly think we'll end up becoming very good friends," Trump said.

After Trump boarded Air Force One, he tweeted a highlight reel of the trip:

In the caption the president said: "THANK YOU to our generous hosts in Hanoi this week: President Trong, Prime Minister Phuc, and the wonderful people of Vietnam!"

Read the full list of existing US sanctions on North Korea, in place since 2008, here.

The Nuclear Threat Initiative has identified about 12 North Korea nuclear sites.