WARSAW — President Andrzej Duda said on Tuesday that he would sign into law a bill making it illegal to accuse “the Polish nation” of complicity in the Holocaust and other Nazi atrocities, a measure that has roiled relations with Israel and the United States, and spurred claims that the nationalist government is trying to whitewash one of the bloodiest chapters in Poland’s history.

Opponents have predicted that the law — which prohibits, among other things, the phrase “Polish death camp” — would stifle free speech and put questions of historical accuracy into the hands of judges and prosecutors who may be more motivated by politics than scholarship. Despite weeks of ferocious criticism from other nations and from independent scholars, Mr. Duda’s right-wing Law and Justice Party pressed ahead with the bill.

Mr. Duda said in a speech broadcast on Polish television and radio that he would sign the measure, while asking the Constitutional Court to determine whether the law violated free-speech protections and to make clear specifically what kinds of speech could be prosecuted. He said that the government wanted to be sure that survivors of war crimes felt free to tell their stories without fear.

But a judicial review is unlikely to placate those who have accused the Law and Justice Party of dangerous revisionism. It is unclear when the high court, which is controlled by judges appointed by Mr. Duda’s party, might act; the law would remain in effect at least until then.