President Barack Obama told reporters on Sunday he would withhold criticism of Donald Trump when the real-estate mogul becomes president in January.

“I want to be respectful of the office and give the president-elect an opportunity to put forward his platform and his arguments without somebody popping off in every instance,” Obama told reporters at an economic-cooperation summit in Lima, Peru.

But Obama warned that he wouldn’t remain silent if he felt Trump’s administration were attacking American values.

“As an American citizen who cares deeply about our country, if there are issues that have less to do with the specifics of some legislative proposal but go to core questions about our values and our ideals, and if I think that it is necessary or helpful for me to defend those ideals, I’ll examine it when it comes,” Obama said.

Obama and Trump were fiercely critical of each other during the campaign, with Obama at times calling Trump “unfit” to be president while campaigning fiercely for his preferred successor, Democrat Hillary Clinton. But since Trump’s unexpected victory in this month’s election, the two appear to have struck a conciliatory tone.

"We now are going to want to do everything we can to help you succeed, because if you succeed, then the country succeeds," Obama told Trump in front of reporters after the two met privately in the White House.

If Obama keeps his word, he'll follow the legacy of his predecessor, George W. Bush, who made a point of almost never criticizing Obama. Bush once said such attacks would be damaging to the presidency.

"I don't think it's good for the country to have a former president undermine a current president," he said in 2014. "I think it's bad for the presidency, for that matter."