The law allows the authorities to prosecute foreign non-governmental organisations (NGOs) or firms designated as "undesirable" on national security grounds.
Individuals working for NGOs could face fines or up to six years in prison.
Critics say it is a Kremlin move aimed at stifling dissent.
The definition of "undesirable" is open to interpretation, but the Interfax news agency said it would apply to organisations deemed to pose a threat to the "foundations of Russia's constitutional order, defensive capacity and security".
NGOs linked to politics in Russia already face restrictions under a 2012 law requiring them to register as "foreign agents".
Supporters of the new bill say it is essential to prevent Russia from outside interference, amid ongoing tensions due to Russia's involvement in Ukraine.
But there was concern from Western governments and NGOs about the implications.
The US state department said it was "deeply troubled" by the law.
"We are concerned this new power will further restrict the work of civil society in Russia and is a further example of the Russian government's growing crackdown on independent voices and intentional steps to isolate the Russian people from the world," spokeswoman Marie Harf said in a statement.
Britain's Minister for Europe, David Lidington, said it was "yet another example of the Russian authorities' harassment of NGOs and those who work with them in Russia".
Amnesty International said the bill would "squeeze the life" from civil society, while Human Rights Watch (HRW) warned it would be locals who would be worst-hit.
"We are often asked - is this draft law aimed against international rights groups like yours?" said Hugh Williamson, HRW's Europe and Central Asia Director.
"But in fact, there is little doubt that its primary targets are Russian activists and Russian independent organisations."
The Russian President Vladimir Putin has signed a bill which allows foreign organisations to be banned from operating in the country.