JERUSALEM — Prime Minister Benjamin Netanyahu has backed down under pressure before, but rarely in such a spectacular fashion as he did on Tuesday when he reneged on a deal with the United Nations to resettle thousands of African asylum seekers in Western countries.

Mr. Netanyahu announced the deal to great fanfare on Monday, only to suspend it a few hours later. On Tuesday, he canceled it completely and defended his abrupt reversal, saying he was responding to an outcry from members of his conservative Likud party as well as partners in his governing coalition who routinely refer to the migrants as “infiltrators” and want all of them expelled.

But the capitulation dented Mr. Netanyahu’s image as a master political player.

“This sort of zigzagging is not at all unusual,” said Gadi Wolfsfeld, a professor of political communications at the Interdisciplinary Center Herzliya near Tel Aviv. “But for someone considered such a political genius to make such a miscalculation, that’s the surprising part of the story.”

The episode was a reminder of how beholden Mr. Netanyahu is to hard-liners in his party and his government, constraining him domestically and diplomatically, whether in making concessions to the Palestinians or in fulfilling an agreement to create an egalitarian prayer space at the Western Wall in Jerusalem.