Police in Brazil's tourism capital have begun photographing and fingerprinting all US visitors arriving at its main international airport.
US travellers will face tough immigration checks in Brazil
The security measure extends a law passed by a Brazilian federal judge on Thursday to check all incoming US citizens at Sao Paulo airport.
The judge's order is in response to a US announcement that it would be vetting visitors from many countries.
But Rio's mayor says the extra checks will damage Brazil's tourist industry.
Brazil's Federal Public Ministry filed a complaint in a federal court over the US immigration measures, arguing its citizens were being unfairly discriminated against and urging the US to remove Brazil from its list of security threats.
Judge Julier Sebastiao da Silva agreed, saying "I consider the act absolutely brutal, threatening human
rights, violating human dignity, xenophobic and worthy of the
worst horrors committed by the Nazis. "
The US-VISIT security system - to be introduced on Monday - hopes to identify travellers who have violated immigration controls, have criminal records or belong to groups listed as terrorist organisations by the US.
Some see the decision by Brazil to counteract the US security procedure with its own law as a tit-for-tat response.
US travellers in Rio have expressed mixed views over Brazil's decision to vet them.
"I am sympathetic with Brazil," one US tourist said.
"I am in disagreement with my government for making people pay a lot for a visa, making them get fingerprinted and stamped. If Brazil does it, I understand."
Others were frustrated by the digital divide between the two countries.
"Ours is all electronic scanning, in and out in a heartbeat," US traveller Lorin Hall said.
"Here, it's 15 to 20 minutes per person with only one person working."
There are also fears in Brazil the move could affect tourism during the upcoming carnival season in Rio.
Carlos Alberto Ferreira from the Brazilian Association of Travel Agencies said: " This is not good for the city nor the state."
"I think the Brazilian Government needs to express to the US Government that Brazilians are suffering with their restrictions in American airports but we shouldn't be doing this in retaliation."
The US said it would watch the new Brazilian rules closely, but stressed that it was the country's right to impose such requirements.