Prime Minister Benjamin Netanyahu on Saturday welcomed praise from Donald Trump for Israel’s security barrier, writing on Twitter that the US president “is right” about walls preventing illegal immigration.

Referring to a second barrier, the recently built fence along Israel’s border with Egypt, the prime minister said the measure had been a “great success” in keeping out migrants, who mainly came from African nations.

“President Trump is right. I built a wall along Israel’s southern border. It stopped all illegal immigration. Great success. Great idea,” Netanyahu wrote in English on Twitter, Trump’s preferred method of communication. The prime minister ended his tweet with emojis of the Israeli and American flags.

Get The Times of Israel's Daily Edition by email and never miss our top stories Free Sign Up

In an interview with Fox News on Thursday, Trump appeared to be touting Israel’s West Bank security barrier as an example of a successful deterrent to unlawful entry into a country. Israel built the barrier — a combination of fence, concrete wall and sophisticated sensors — in response to the massive wave of deadly Palestinian terrorism that hit the country during the Second Intifada at the start of the millennium, with suicide bombers traveling the short distances into Israel to carry out murderous attacks, and it saw a dramatic fall in suicide bombings.