Department of Homeland Security Secretary John F. Kelly pushed back Friday against comments made by former President Barack Obama about constructing a border wall.

“We’re not hiding behind a wall. We’re constructing physical barriers backed up by technology, and of course the great men and women of customs and border protection, to simply safeguard our Southern border,” Mr. Kelly said on Fox News. “We’re not hiding behind a wall, and you can’t defend anything by hiding behind something.”

Mr. Obama said in Berlin Thursday that the United States cannot “hide behind a wall” to avoid problems. The former president was in Europe to deliver a speech at the Brandenburg Gate to mark the 500th anniversary of the Protestant Reformation with Chancellor Angela Merkel.

Mr. Trump met with NATO allies in Brussels the same day, including Ms. Merkel.

Mr. Kelly was also asked on CBS News if he was worried about leaks coming out of the Department of Homeland Security after sensitive information about the Manchester, England, attack was leaked in The New York Times.

“I’m not. But no one is perfect. No organization is perfect. I would tell you that right after the bombing happened, I called my counterpart, who I have a great relationship with, in the U.K. She brought the issue up with me. She has an absolute right to be furious about these leaks,” he said.

Mr. Kelly said Mr. Trump did the right thing in launching an investigation to find out who or where the leak was coming from.

“I think exactly the right thing for the president to do is to get the investigators on it, find out who it is. Totally unacceptable, particularly when it comes to classified information,” he said.