African migrants and Israelis demonstrate in Tel Aviv on Tuesday against the Israeli government's policy to forcibly deport African refugees and asylum seekers. (Jack Guez/AFP/Getty Images)

Israeli Prime Minister Benjamin Netanyahu on Tuesday scrapped an agreement with the United Nations to resettle thousands of African asylum seekers in the West, giving in to pressure from immigration hard-liners who saw the deal as rewarding illegal migrants.

After speaking to residents of southern Tel Aviv, a traditionally working-class area where many African migrants settled in recent years, Netanyahu said he “decided to cancel the agreement.”

Without the U.N. deal, thousands of Sudanese and Eritrean migrants will be left in legal limbo within Israel. Around 38,000 live in Israel, most of whom entered the country illegally via the land border with Egypt before a fence was completed in 2013. 

Activists say many would face persecution if they were returned home. 

On Monday, Netanyahu announced an “unprecedented understanding” with the U.N. refugee agency that would move more than 16,000 migrants to Western nations. The same number would be given temporary residency status within Israel.

Netanyahu concurrently announced that Israel would set up a body to implement a “rehabilitation plan” for southern Tel Aviv and encourage African migrants to move out of the area.

The agreement took many in Israel by surprise. Under a deportation initiative being carried out since February, male African migrants had been given notices warning them that they had two months to leave the country or face jail.

The migrants were offered $3,500 to relocate to an unnamed “third country” — widely reported to be Uganda or Rwanda — or return to their home country.

Legal and political problems had slowed the deportation plan dramatically. Advocacy groups working on behalf of the migrants challenged the policy in Israel’s high court, securing a temporary freeze of the plan on March 15.

The agreement with the United Nations was greeted with praise from many human rights groups, but the number of African migrants allowed to stay in the country proved to be a problem for Netanyahu’s base. One poll released by Israel’s Channel 10 found that 47 percent of the country was against the deal, while 34 percent supported it.

In a late-night Facebook post Monday, Netanyahu said he would suspend the agreement’s implementation until he had a chance to speak to delegates from neighborhoods in southern Tel Aviv. 

The pause in the plan dominated Israel’s front pages Tuesday, with Yedioth Ahronoth, the ­largest-circulation newspaper in the country, running the headline: “Netanyahu Folds.”

For critics, suspension alone was not enough. Naftali Bennett, leader of the nationalist Jewish Home party, tweeted critically of the U.N. agreement early Tuesday, saying Netanyahu should “cancel it altogether.” 

“Its approval would cause generations of crying and set a precedent in Israel granting residency for illegal infiltrators,” he wrote.

Just hours later, Netanyahu called off the resettlement plan. “We’ll keep looking for solutions,” he said in a statement.

Anshel Pfeffer, a correspondent for the Haaretz newspaper and author of a forthcoming biography of Netanyahu, said that the Israeli leader had underestimated the opposition to the agreement and that an ongoing corruption scandal had left him susceptible to social media backlash.

“In the space of 20 hours, he held four different positions,” Pfeffer said. “Netanyahu is supposed to be a strong and decisive leader. What this shows us is how his current political situation is so precarious that he finds himself buffeted by every passing wind from Facebook.”

William Spindler, a spokesman for the Office of the U.N. High Commissioner for Refugees, said the agency would continue looking for a “win-win agreement that can benefit Israel, the international community and people needing asylum.”

It is unclear if Israel could now return to its previous plan to deport African asylum seekers. In his Facebook post Monday night, Netanyahu said Rwanda had come under “tremendous pressure” from the European Union and the New Israel Fund, a nonprofit based in the United States, prompting the African nation to back out of agreements with Israel.

The Israeli prime minister called Tuesday evening for a parliamentary investigation of the New Israel Fund, writing on Facebook that the nonprofit received funding from billionaire financier George Soros and that it endangered the “security and future of the State of Israel as the nation-state of the Jewish people.”

Daniel Sokatch, chief executive of the New Israel Fund, denied claims that the fund had pressured Rwanda and offered to answer any questions the Israeli government has. Netanyahu “lashes out to deflect attention from his own morally bankrupt choices,” Sokatch said Tuesday.