JERUSALEM — President Trump has invoked Israel’s “wall” as a model for the barrier he has vowed to build along the United States’ border with Mexico. His wall, he says, will keep out illegal immigrants who bring drugs and crime into America.

“A wall protects,” Mr. Trump told Sean Hannity of Fox News on Thursday. “All you have to do is ask Israel. They were having a total disaster coming across and they had a wall. It’s 99.9 percent stoppage.”

It is not immediately clear which “wall” Mr. Trump was referring to. Israel has built fences along its borders with Egypt; along its northern border with Lebanon; and along its boundary with the Gaza Strip.

But Israel’s best-known barrier is the one built along and inside the West Bank after a surge of terrorist attacks. It was intended to regulate Palestinian movement into Israel.