“The friendships we’ve established with countries like Peru, the reopening of diplomatic relations with Cuba, investments we’re making in trade, environmental policies and so forth — all those things I expect to continue,” he added.

Mr. Trump has offered contradictory views on Cuban relations. Early in his campaign, Mr. Trump claimed to support restoring ties, but he said more recently in Miami that Mr. Obama should have gotten a better deal.

Mr. Obama was speaking to aspiring entrepreneurs and civil society leaders about how to improve their lives and countries — one of his preferred activities — during the last stop of his final overseas trip as president. He began his trip on Tuesday in Greece, went to Germany on Wednesday and flew to Peru on Friday to attend the Asia-Pacific Economic Cooperation summit meeting. Along the way, he has tried, with limited success, to reassure audiences that Mr. Trump will not discard the agreements and priorities that Mr. Obama has devoted much of his presidency to advancing.

His toughest task was here at a summit meeting of an organization that helped birth the Trans-Pacific Partnership trade agreement, an accord that is almost certainly dead as a result of Mr. Trump’s victory. Also, one of Mr. Trump’s signature campaign strategies was to demonize immigrants from Latin America, and he referred to those crossing the border from Mexico as rapists and criminals. Just about every question posed to Mr. Obama from the audience here had to do with the anxiety Mr. Trump has stirred in this part of the world.

“The United States is such a big country that, after any election, people are uncertain,” Mr. Obama said. “I think it will be important for people around the world to not make immediate judgments.”