Shortly after Donald Trump's surprise election win, Barack Obama gave some advice to President Xi Jinping in the final minutes of their last meeting as leaders of the world's biggest economies.

Obama explained the factors that led to Trump's victory following a campaign that featured regular China-bashing, and suggested that Xi take steps to put relations with the U.S. on a sustainable path, according to a person familiar with the meeting which took place on the sidelines of the Asia-Pacific Economic Cooperation summit in Lima, Peru.

After carefully listening to Obama, the person said, Xi replied that he wouldn't throw the first punch at Trump — but he also wouldn't sit back and take one.