Israeli Prime Minister Benjamin Netanyahu speaks with Honduran President Juan Orlando Hernández in Brasilia on Jan. 1, 2019. (Office of the Hondura Presidency/Reuters) (Handout/Reuters)

Last week, the Trump administration criticized Honduras as being weak on immigration. President Trump wrote in a tweet that Honduras was “doing nothing” about a new caravan of migrants allegedly forming in the nation and threatened to cut off U.S. aid to Honduras, Guatemala and El Salvador.

This week, officials from the two countries met in Brazil to hash out their differences, moderated by an unlikely figure: Israeli Prime Minister Benjamin Netanyahu.

Netanyahu took part in the Tuesday meeting between U.S. Secretary of State Mike Pompeo and Honduran President Juan Orlando Hernández. All three men were in Brazil for the inauguration of President Jair Bolsonaro, which also took place Tuesday. An Israeli official told the newspaper Haaretz that the meeting was arranged by Netanyahu at the request of Hernández, who sought the Israeli leader’s help in dealing with the United States.

In return, Honduras pledged to move its embassy in Israel from Tel Aviv to Jerusalem, in what could be another boost for Netanyahu ahead of parliamentary elections in April.

Before Pompeo left for Brazil, it was not clear whether he would meet with Hernández. Briefing reporters, a senior State Department official said before the trip that Trump expected Honduras and other governments to do more to stem the outflow of migrants to the United States and that “there will be consequences if they do not.”

A previous migrant caravan, which left Honduras in mid-October, journeyed through Central America and Mexico on the way to the U.S. border. Trump turned the caravan into an election-season boogeyman, characterizing it as an imminent threat and even deploying active-duty troops to the border.

After the meeting Tuesday, the three sides released a short statement saying they had agreed to strengthen political relations and coordination — and emphasized that Israel would open an embassy in the Honduran capital, Tegucigalpa, while Honduras would open an embassy in Jerusalem.

If Honduras follows through with the move, it will please both Trump and Netanyahu. The United States moved its embassy in Israel to a U.S. Consulate building in Jerusalem in May, months after Trump said he would overturn decades of U.S. policy and officially recognize the city as the capital of Israel.

Palestinians consider East Jerusalem, captured by Israel in the 1967 Arab-Israeli war, as the capital of their future independent state. Two other Latin American countries, Guatemala and Paraguay, have relocated their embassies to Jerusalem — the latter moved its embassy back to Tel Aviv in September.

A number of other nations, including Brazil and Australia, have suggested they will move their embassies to Jerusalem in the future.

Read more:

Netanyahu could soon be Israel’s longest-serving prime minister — despite decades of scandals

The U.S. says it is pulling out of Syria. Who are the big winners and losers?

Netanyahu puts wrong foot forward by serving Japan’s Abe dessert in a shoe