The government of Mexico has admonished Israel for a tweet by Israeli Prime Minister Benjamin Netanyahu which praised Trump 's plan to build a wall on the southern border with Mexico to keep out illegal immigrants.

"President Trump is right. I built a wall along Israel's southern border. It stopped all illegal immigration. Great success. Great idea," Netanyahu tweeted.

A Mexican statement said: "The foreign ministry expressed to the government of Israel, via its ambassador in Mexico, its profound astonishment, rejection and disappointment over Prime Minister Netanyahu's message on Twitter about the construction of a border wall."

The statement added: "Mexico is a friend of Israel and should be treated as such by its prime minister."

A spokesperson for the Israeli foreign ministry, Emmanuel Nahshon, said the Israeli leader's comment was about his country's "specific security experience" and not about US-Mexico ties.

Mexican President Enrique Pena Nieto on Thursday cancelled a proposed meeting with Trump after he advised him to call off his visit if Mexico was not willing to pay for the wall.

The Jewish community in Mexico said in a statement that they "forcefully reject" Netanyahu's remark.

Leon Krauze, a Jewish Mexican said on Twitter: "As a Mexican Jew, grandchild of immigrants: I'm ashamed of this [Netanyahu's] tweet."