Israeli President Reuven Rivlin apologized to Mexican President Enrique Peña Nieto Tuesday after Prime Minister Benjamin Netanyahu tweeted his apparent support for a wall on the Mexico-United States border.

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

On a call with Peña Nieto Tuesday, Rivlin called the ensuing diplomatic rift a "misunderstanding," Spanish news agency EFE reported

ADVERTISEMENT

"We have no intention to compare Israel's security situation and the needs that emanate from it, and the situation faced by countries that are friends of Israel," Rivlin said.

The Mexican Secretariat of Foreign Affairs expressed its "profound surprise, rejection and disappointment" to the Israeli ambassador in Mexico City shortly after the tweet.

Rivlin differentiated the situation on Israel's borders from the Mexican-American border, saying, "The security circumstances in Israel and the region were what led to the important decision of building a wall on the border."

Peña Nieto told Rivlin that "Mexico has always sought a very close relationship with Israel and has welcomed with open arms the Jewish community, which day-to-day makes a valuable and important contribution to the country's development," according to a statement from the Mexican government.

Netanyahu said his tweet was not directly related to the U.S.-Mexico border.

Israel's Foreign Ministry spokesman tweeted Saturday on the matter, saying Netanyahu's tweet verged on "our specific security experience which we are willing to share. We do not express a position on US-Mexico relations."

President Trump made construction of a border wall a central issue of his campaign, and last week signed an executive order mandating its construction.

The executive order and ensuing back-and-forth statements by Peña Nieto and Trump ultimately led to the cancellation of a work meeting between the two in Washington planned for Tuesday.

In a call Friday, Peña Nieto and Trump agreed to no longer debate in public the issue of the wall and whether Mexico would pay for it.