BERLIN — The Polish government was trying to solve a domestic problem in recent days when it pushed through legislation long sought by hard-line supporters who say the country is unfairly maligned for the horrors that unfolded on its soil during the Holocaust.
But in looking to criminalize those who suggest Poles took part in Nazi atrocities, lawmakers sparked an international uproar. The fallout has included rifts with close allies, condemnation by Jewish groups worldwide and an intense focus on the very questions of complicity that nationalist Poles were hoping to sweep aside once and for all.
"The government achieved exactly the opposite of what it wanted," said Piotr Buras, head of the Warsaw office of the European Council on Foreign Relations. "The unintended consequences and the international damage have been huge."
The episode is just the latest in a series that have left Poland, a nation of 38 million that sits strategically at NATO's eastern frontier, estranged from its Western partners.
After a law limiting the independence of the Polish judiciary has already alienated much of Europe, the Holocaust bill drew an especially stern rebuke from Washington — where President Trump had been considered sympathetic to Warsaw's defiant brand of right-wing populism.
It is unclear how deep the damage runs and whether it can be reversed. The legislation has been passed by both houses of Parliament but requires the signature of the president, who has signaled his support. Regardless of whether he signs the bill, it may have generated bigger problems than the one it was meant to resolve.
"The government is in a trap," Buras said. "They don't want to ruin their relationship with the United States. At the same time, if they back down now, they would ruin their relationship with the party's base. And in Poland, this second factor is more important."
The country's prime minister showed no signs of backing down on Friday, a day after the Polish Senate ignored the international backlash and overwhelmingly approved the legislation. Poland's lower house passed the bill, which mandates fines and jail terms of up to three years, last week.
During a visit to the home town of a Polish family that was murdered during World War II for trying to rescue Jews, Prime Minister Mateusz Morawiecki said it was "very sad" that some people believe Poland shares responsibility for the Holocaust — a responsibility he denies.
"On the other hand, it is extremely important to explain it," he said in remarks reported by Radio Poland.
Poland was invaded and occupied by Nazi Germany in 1939. But unlike in other European countries, there was no collaborationist Polish government. Historians have pointed to incidents, including a 1941 atrocity in the town of Jedwabne, in which Poles rounded up and killed their Jewish neighbors.
Approximately 6 million Polish citizens were killed during World War II, about half of them Jews. The Nazis set up some of the Holocaust's most notorious concentration camps on Polish soil, including Auschwitz, where nearly 1 million Jews and 75,000 non-Jewish Poles died.
The use of the phrase "Polish death camps" has long provoked outrage among Poles. Hard-line supporters of the ruling Law and Justice party, known by its Polish acronym PiS, have for years sought a law that would criminalize its use.
But the draft law passed by Parliament does not mention the phrase and instead is written more broadly to encompass anyone who speaks about Polish involvement in Nazi crimes in a way that runs "counter to the facts."
Legal scholars say the wording is worryingly vague.
"Someone who survived the Holocaust and who says 'I was in a Nazi concentration camp because a Pole delivered me to the Germans' could be subject to criminal prosecution," said Tina de Vries, a research fellow at Germany's Institute of East European Law.
Top Israeli officials have said the law amounts to Holocaust denial.
The State Department on Wednesday said the phrase "Polish death camps" was "inaccurate, misleading, and hurtful." But it also said the proposed legislation "could undermine free speech and academic discourse." The department's statement warned that if the legislation is implemented, it could have "repercussions" for "Poland's strategic interests and relationships."
Before this controversy erupted, Washington was seen as a rare bright spot in Poland's relations with the West.
The United States last year deployed some 5,000 troops to Poland as part of missions intended to reassure NATO members on the alliance's eastern flank. And last summer, Trump chose to visit Warsaw before setting foot in other major European capitals. He went out of his way to praise his hosts and avoided directly criticizing the government's record on the rule of law.
Poland's European counterparts, meanwhile, have accused the country of already veering away from liberal democracy. Fellow members of the European Union have threatened to impose sanctions against it over its controversial judicial amendments.
Against that backdrop, Poland had seemed to be trying in recent weeks to ease tensions. It has a new prime minister and foreign minister, both from the ruling party's more moderate wing.
But that also created unease among ardently nationalist PiS hard-liners. Pushing the Holocaust bill, Buras said, was a way to satisfy them.
Given the backlash, all eyes will now be on President Andrzej Duda, a PiS ally who occasionally has been willing to buck the party's will. Duda, who has three weeks to sign or reject the bill, told the state broadcaster that "we, as a nation, have a right to defend ourselves from an evident slander."
But that was before even some Law and Justice members began to question the wisdom of a push that has fired up conversations that were meant to be shut down.
"There are now [references to] 'Polish death camps' all over the place," Sen. Anna Maria Anders said during Thursday's debate. "The result is not what we wanted it to be."
Rick Noack and Luisa Beck contributed to this report. This story has been updated to more fully reflect debate over the role of Polish citizens in the Holocaust.