MOSCOW (AP) — Russia's lower house of parliament on Wednesday unanimously approved a bill allowing the government to register international media outlets as foreign agents, a swift retaliation to the U.S. demands made to a Russian TV channel.

The bill comes days after the Russian state-funded RT registered with the U.S. Justice Department as a foreign agent following pressure from Washington.

U.S. intelligence agencies allege that RT served as a Kremlin tool to meddle in the 2016 U.S. presidential election. Russia has denied any interference.

Russian President Vladimir Putin harshly criticized the U.S. demand regarding RT as an attack on freedom of speech, and had warned that Russia would retaliate.

During Wednesday's debates, State Duma speaker Vyacheslav Volodin described the new legislation as a "symmetrical answer" to the U.S. and a signal that "our media can't be treated like that."

The bill will now pass to the upper house, which is expected to quickly rubber-stamp it next week, and then to Putin for signing.

Putin's spokesman Dmitry Peskov said the legislation will provide the necessary framework for the government to retaliate any moves against Russian media abroad.

"Any infringement on the freedom of Russian media abroad will not be left without a harsh answer," Peskov said. He added that the government will "use the opportunities offered by the bill for a timely quid-pro-quo response."

The broadly phrased bill will leave it to the Russian government to determine which foreign media outlets would be designated as foreign agents, said Leonid Levin, the head of the Duma committee for information.

He noted that the measure would allow Russia to mirror the U.S. demands for RT or any other such action taken by other countries.

"I would like to hope that it will only be used once and there will be no need for more retaliatory action," he added.

Pyotr Tolstoy, a deputy speaker of the Duma who authored the bill, said he expects the Justice Ministry to take "pinpoint retaliatory measures."

He emphasized that the new legislation relates only to foreign media outlets and doesn't refer to Russian media with foreign funding.

Even before the bill's full approval, the Justice Ministry quickly sent letters to U.S. government-funded broadcaster Radio Free Europe/Radio Liberty, warning that some of its operations could face restrictions under the new legislation.

Joanna Levison, director of media and public affairs at RFE/RL, said the letters were addressed to its Russian Service and Idel Realii, the Volga region website. "They inform us that we may be subject to restrictions under the 'foreign agent' law," she said.

Media outlets singled out as foreign agents will face the requirements currently applied to foreign-funded non-governmental organizations under a 2012 law.

That law, which was passed in the wake of massive anti-Kremlin protests in Moscow, requests all groups that receive foreign funding and engage in vaguely defined political activities to register as foreign agents. It requires them to publicly declare themselves as such and regularly provide detailed information about their funding, finances and staffing.

Just like the 2012 law, the new bill is loose enough to target anyone.

Maria Lipman, an independent Moscow-based analyst, said the new legislation looks "intentionally blurred" and will work "as a truncheon raised in the air, so that various organizations ... should be intimidated not knowing whose head this truncheon will hit."

Amnesty International harshly criticized the new bill as an attack on media freedom.

"This legislation strikes a serious blow to what was already a fairly desperate situation for press freedom in Russia," Denis Krivosheev, the group's deputy director for Europe and Central Asia, said in a statement. "Over the last couple of years, the Kremlin has been tirelessly building a media echo chamber that shuts out critical voices, both inside Russia and from abroad."

The German government also strongly criticized the legislation.

"We view this new media law with concern and surprise," Chancellor Angela Merkel's spokesman, Steffen Seibert, told reporters in Berlin. "We think it is completely unacceptable if German and European media are — as a consequence of a Russian-American controversy — to be subjected to restrictions which ... go against international obligations that we took together."

German Foreign Ministry spokesman Rainer Breul noted that the legislation hasn't yet passed so "it is perhaps a bit early to talk about the concrete consequences."

"Ultimately a lot will depend on how exactly the law is implemented and to what extent it restricts foreign media's ability to act," he said.

___

Geir Moulson in Berlin contributed to this report.