US President Donald Trump and North Korean leader Kim Jong Un have concluded an extraordinary summit by signing a joint document in which they commit to working towards the "complete denuclearisation of the Korean Peninsula".
The document signed by the two leaders also said they will join efforts "to build a lasting and stable peace regime" on the Korean Peninsula.
The White House has yet to release the document's text, but it was photographed by the news media during a signing ceremony in Singapore.
The broad agreement was light on specifics, largely reiterating previous public statements and past commitments.
It did not include an agreement to take steps towards ending the technical state of warfare between the US and North Korea.
As they ended their summit Mr Trump praised Mr Kim as a "very worthy, very smart negotiator".
They concluded the meeting with lofty promises by the US president to take care of a "very dangerous problem" and Mr Kim forecasting "major change for the world".
The US president said the meeting went "better than anybody could imagine".
Mr Trump was asked by reporters during his final appearance with Mr Kim what surprised him most during their meetings.
He said Mr Kim has a "great personality" and is "very smart", which he described as a "good combination".
The president said the pair had "a terrific day" and "learned a lot about each other and about our countries". He added that he expects they will meet again many times.
Mr Trump also said he "absolutely" would invite Mr Kim to the White House.
Meeting with staged ceremony on a Singapore island, Mr Trump and Mr Kim came together for a summit that seemed unthinkable just months ago, clasping hands in front of a row of alternating US and North Korean flags, holding a one-on-one meeting, additional talks with advisers and a working lunch.
Throughout the summit that could chart the course for historic peace or raise the spectre of a growing nuclear threat, both leaders expressed optimism.
Mr Kim called the sit-down a "good prelude for peace" and Mr Trump pledged that "working together we will get it taken care of".
In advance of their private session, Mr Trump predicted "tremendous success" while Mr Kim said through an interpreter that "we have come here after overcoming" obstacles.
Aware that the eyes of the world were on a moment many people never expected to see, Mr Kim said many of those watching would think it was a scene from a "science fiction movie".
In the run-up to the meeting, Mr Trump had predicted the two men might strike a nuclear deal or forge a formal end to the Korean War in the course of a single meeting or over several days.
But in the hours before the summit, the White House unexpectedly announced Mr Trump would depart Singapore earlier than expected - raising questions about whether his aspirations for an ambitious outcome had been scaled back.
Giving voice to the anticipation felt around the world, South Korean President Moon Jae-in said he "hardly slept" before the summit.
Mr Moon and other officials watched the live broadcast of the summit before a South Korean cabinet meeting in his presidential office
The meeting was the first between a sitting US president and a North Korean leader.
After meeting privately and with aides, Mr Trump and Mr Kim moved into the lunch at a long table covered with flowers. As they entered, Mr Trump injected some levity to the day's extraordinary events, saying: "Getting a good picture everybody? So we look nice and handsome and thin? Perfect."
Then they dined on beef short rib confit along with sweet and sour crispy pork.
And as they emerged from the meal for a brief stroll together, Mr Trump appeared to delight in showing his North Korean counterpart the interior of "The Beast", the famed US presidential limousine known for its high-tech fortifications.
Critics of the summit leapt at the leaders' handshake and the moonlight stroll mr Kim took on Monday night along the glittering Singapore waterfront, saying it was further evidence that Mr Trump was helping legitimise Mr Kim on the world stage as an equal of the US president.
Mr Kim has been accused of horrific rights abuses against his people.
Mr Trump responded to such commentary on Twitter, saying: "The fact that I am having a meeting is a major loss for the U.S., say the haters & losers." But he added "our hostages" are back home and testing, research and launches have stopped.
Mr Trump also tweeted: "Meetings between staffs and representatives are going well and quickly ... but in the end, that doesn't matter. We will all know soon whether or not a real deal, unlike those of the past, can happen!"
The summit capped a dizzying few days of foreign policy activity for Mr Trump, who shocked US allies over the weekend by using a meeting in Canada of the G7 economies to alienate America's closest friends in the West.
Lashing out over trade practices, Mr Trump lobbed insults at his G7 host, Canadian Prime Minister Justin Trudeau.
Mr Trump left that summit early and, as he flew to Singapore, tweeted that he was pulling the US out of the group's traditional closing statement.
The optimistic summit was a remarkable change in dynamics from less than a year ago, when Mr Trump was threatening "fire and fury" against Mr Kim, who in turn scorned the American president as a "mentally deranged US dotard".
Beyond the impact on both leaders' political fortunes, the summit could shape the fate of countless people - the citizens of impoverished North Korea, the tens of millions living in the shadow of the North's nuclear threat, and millions more worldwide.
Alluding to the North's concerns that giving up its nuclear weapons could surrender its primary deterrent to forced regime change, secretary of state Mike Pompeo told reporters that the US was prepared to take action to provide North Korea with "sufficient certainty" that denuclearisation "is not something that ends badly for them".
He would not say whether that included the possibility of withdrawing US troops from the Korean Peninsula, but said the US was "prepared to take what will be security assurances that are different, unique, than America's been willing to provide previously".
The North has faced crippling diplomatic and economic sanctions as it has advanced development of its nuclear and ballistic missile programmes.