By Alissa de Carbonnel

MOSCOW (Reuters) - Russia moved closer on Friday to adopting a law barring entry to Americans who violate human rights, the same day U.S. President Barack Obama signed into law a rights-linked trade bill Moscow finds objectionable.

The tit-for-tat response came in a near-unanimous vote in the State Duma - the first of three votes before the bill goes to the upper house - hours before Obama signed the U.S. legislation into law.

The U.S. legislation is known as the Magnitsky Act after Sergei Magnitsky, an anti-corruption lawyer whose death in a Moscow jail in 2009 caused an international outcry.

It will require the United States to refuse visas for Russians accused of human rights violations and freeze any assets they hold in the United States.

Only two deputies in the 450-seat Duma voted against Russia's retaliatory bill, which would deny visas to Americans who violate the rights of Russians abroad, as well as seizing their assets and preventing them from doing business in Russia.

In debate peppered with belligerent speeches reminiscent of Cold War rhetoric, all four parties backed the bill - a rare display in a chamber where the Communists and Just Russia frequently vote against Kremlin-controlled United Russia.

"We will answer in kind," said Vladimir Vasiliyev, the senior lawmaker for United Russia, which holds a majority in the Duma. "The saddest thing is that ... the hawks (in the United States), Cold War hawks, have again won out."

"The Magnitsky Act is just an excuse to meddle in our internal affairs," said Just Russia deputy Alexander Tarnavsky.

The spat may make it harder for the two nations to halt a downward drift in relations, which had improved after Obama launched a "reset" of ties in 2009.

"WHAT GOES AROUND, COMES AROUND"

The former Cold War foes Have clashed over the Syria conflict and U.S. criticism of the Kremlin's treatment of political opponents, particularly after President Vladimir Putin's return to the Kremlin in May.

Putin signaled on Thursday that he wants to limit the damage from the dispute, saying that Russia's response to the bill must not be "excessive".

Russian Foreign Ministry spokesman Alexander Lukashevich echoed that message on Friday.

He warned that "what goes around comes around" and said U.S. lawmakers seemed to want "to sacrifice the capital that has been built up in Russian-American relations", but also suggested the response would be measured.

"We value our strategic interaction with the United States, and for this reason the reaction even to such an unfriendly step should be proportionate," Lukashevich told journalists at a weekly briefing.

The Russian bill says Americans affected will include those involved in "unfounded or unjust" sentences against Russians - a nod to Viktor Bout, a Russian arms trader serving a 25-year prison term in the United States in what Moscow says was a politically motivated prosecution and unfair trial.

The Russian bill, expected to be signed by Putin before the end of the year, also targets Americans accused of abusing Russian-born adopted children and U.S. judges or authorities deemed to have been too lenient in such cases.

Pro-Kremlin lawmakers have proposed the bill be named after Dima Yakovlev, a Russian-born boy who died at the age of 18 months after his adoptive U.S. family left him locked in a vehicle in Virginia in 2008.

(Reporting by Alissa de Carbonnel; Editing by Timothy Heritage, Steve Gutterman and Michael Roddy)