Former President Barack Obama Barack Hussein ObamaThe Hill's 12:30 Report - Presented by Facebook - Don't expect a government check anytime soon Trump appointees stymie recommendations to boost minority voting: report Obama's first presidential memoir, 'A Promised Land,' set for November release MORE on Thursday encouraged people not to "hide behind a wall," making an oblique dig at President Trump during a talk in Berlin.

"In this new world we live in, we can’t isolate ourselves," Obama said while on stage with German Chancellor Angela Merkel during a forum in Berlin, according to The Associated Press.

"We can’t hide behind a wall."

Trump's signature campaign promise was to build a wall on the U.S.-Mexico border to curb illegal immigration.

During the event, which marked the 500th anniversary of the Protestant Reformation, Obama told the audience that "we have to push back against those trends that would violate human rights or suppress democracy or restrict individual freedoms."

ADVERTISEMENT

He also issued a warning about people who are always certain about their opinions, another apparent criticism of Trump.

"If I become so convinced that I’m always right,” Obama said, “the logical conclusion of that often ends up being great cruelty and great violence.”

The former president offered praise for Merkel, calling the German leader one of his "favorite partners" in his presidency and someone who had done "outstanding work."

Despite tensions that emerged after revelations in 2013 that the National Security Agency had tapped Merkel's and other German officials' phone lines, the American and German leaders were seen as having a cooperative relationship. During a trip to Germany in November, Obama called Merkel his "closest ally."

Trump met Merkel for the first time at the White House earlier this year. He has frequently been critical of the German leader for what he calls open-border policies and Germany's willingness to offer asylum for refugees.