President Donald Trump and North Korean leader Kim Jong Un's second summit in Hanoi, Vietnam, ended early and without a deal.

Trump said it was because Kim wanted total sanctions relief in exchange for closing only some of his nuclear sites.

The White House was confident enough in a deal to schedule a 35-minute-long signing ceremony for Thursday afternoon.

This was ultimately abandoned after Trump announced an early end to the summit.

President Donald Trump's administration was confident enough in reaching a deal with North Korean chairman Kim Jong Un at the summit in Vietnam that it had scheduled a signing ceremony for the two leaders.

Trump and Kim were due to take part in a 35-minute-long "Joint Agreement Signing Ceremony" after their lunch on Thursday, according to the White House's public schedule.

The ceremony was abandoned when the White House announced an early end to the summit, with no deal between the countries.

Here's what the schedule said. The first time for each event is local time in Vietnam, and the second is local time in Washington, DC.

11:55 a.m./11:55 p.m. THE PRESIDENT participates in a working lunch with the Chairman of the State Affairs Commission of the Democratic People’s Republic of Korea

Hanoi, Vietnam

2:05 p.m./2:05 a.m.THE PRESIDENT participates in a Joint Agreement Signing Ceremony with the Chairman of the State Affairs Commission of the Democratic People’s Republic of Korea

Hanoi, Vietnam

At 2:40 p.m. Trump was scheduled to leave the Sofitel Legend Metropole Hanoi, the five-star hotel where Trump and Kim met on Thursday, to return to the JW Marriott, where the US delegation is staying.

Instead, he got on Air Force One and flew home.

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

How the plan unraveled

The two leaders ended up skipping lunch, and Trump moved his press conference — first scheduled for 4 p.m. — two hours earlier.

The Washington Post's David Nakamura, who traveled to Hanoi with the White House, said at 12:25 p.m. that a meeting between the US and North Korean delegations appeared to be running 30 minutes behind schedule, and that lunch appeared to be delayed.

At 12:35 p.m. a White House spokeswoman told reporters that "there has been a program change," Nakamura said.

"No sign of US or DPRK delegations in the lunch room where table was set with menus and name cards on chairs," he added, using an acronym for Democratic People's Republic of Korea, or North Korea.

Read more: Trump says North Korea summit collapsed because Kim demanded total sanctions relief in exchange for closing only some of his nuclear sites

Trump says he's still friends with Kim

At his press conference later on Thursday Trump said he remains "optimistic" about North Korea's aim to denuclearization and his relationship with Kim, and said they didn't sign a deal because Kim wanted total sanctions relief in exchange for closing only some of his nuclear sites.

"They were willing to denuke a large portion that they want but we couldn't give up all the sanctions for that," Trump told reporters. He added that he could have signed a deal if he wanted to, but "we decided to walk" instead of run.

Sarah Huckabee Sanders, the White House press secretary, also said in a statement that Trump and Kim "had very good and constructive meetings" in Hanoi on Wednesday and Thursday.

"The two leaders discussed various ways to advance denuclearization and economic driven concepts," she added. "No agreement was reached at this time, but their respective teams look forward to meeting in the future."

Trump tweeted a video montage of his Vietnam trip on Wednesday, thanking "our generous hosts" President Nguyen Phu Trong and Prime Minister Nguyen Xuan Phuc and "the wonderful people of Vietnam" for his stay. Kim does not appear in any of the footage.