Critics say Poland's ruling party is creating a mechanism that would allow it to mobilise legal apparatus against political opponents.
Poland's lawmakers voted on Friday to approve a divisive law on Russian influence criticised by the European Union and the US.
There are fears the law, proposed in May by Poland's ruling right-wing Law and Justice party (PiS) could be used to target the political opposition.
When it takes effect, it will create a powerful committee of experts who can investigate alleged Russian interference in Poland and name politicians who allegedly allow it.
The committee could then bar those concerned from holding public positions.
However, critics say it is primarily targeting former Prime Minister Donald Tusk, who is expected to stand in a parliamentary election later this year.
PiS accuses Tusk of having been too friendly toward Russia and President Vladimir Putin as PM between 2007 and 2014 and striking gas deals favourable to Moscow.
Tusk later went to Brussels to be the president of the European Council between 2014 and 2019. He and PiS leader Jarosław Kaczyński are longtime political rivals.
Following criticism, President Andrzej Duda proposed urgent amendments to the law to tone it down.
Poland's lower house (Sejm) voted 235-214 with four abstentions to reject the Senate's veto to the draft law amended by Duda. The legislation now requires Duda's signature to take effect.
The amended bill calls for a commission to check whether between 2007 and 2022 politicians have taken decisions under Russia's influence that could threaten Poland's security.
Duda claims it is needed for transparency's sake and to prevent Russia from jeopardising Poland's future stability.
The US State Department and EU authorities strongly criticised the law in its first version and expressed concerns about its implications for democracy in Poland.
The PiS's encroachments on the independence of the judiciary have raised international alarm in recent years.