JERUSALEM — Prime Minister Benjamin Netanyahu of Israel and some of his senior ministers on Sunday strongly criticized groups who are threatening a boycott of Israel over its policies toward the Palestinians. Their remarks were a sharp retort to Secretary of State John Kerry, who warned a day earlier that the risk of boycotts would intensify should the current Middle East peace effort fail.

In a swift response to the Israeli criticism, the State Department said that Mr. Kerry had always opposed calls for boycotts and expected “all parties to accurately portray his record and statements.”

The heated exchange comes as the Obama administration prepares to complete and present a “framework” accord in the coming weeks, which would be a first step toward a comprehensive agreement and serve as a basis for a continuation of negotiations.

“Attempts to impose a boycott on the state of Israel are immoral and unjust,” Mr. Netanyahu said at the start of the weekly cabinet meeting here. “Moreover,” he continued, “they will not achieve their goal. First, they cause the Palestinians to adhere to their intransigent positions and thus push peace further away. Second, no pressure will cause me to concede the vital interests of the state of Israel, especially the security of Israel’s citizens. For both of these reasons, threats to boycott the state of Israel will not achieve their goal.”