The order, set to go into effect on 1 January, came after a government office filed a complaint in a federal court over the US measure aimed at millions of foreign travellers.

"Unless the court order is contested in the justice system, it will be complied with," said a spokesman for Brazil's Federal Police, the agency overseeing immigration, on Tuesday.

Starting 5 January, citizens of countries such as Brazil who need a visa to enter the United States will be fingerprinted and photographed when they pass through immigration at major US airports and seaports.

The procedure is meant to identify people who have violated immigration controls, have a criminal record or belong to groups the US government lists as "terrorist" organisations.

The checks will not be carried out against citizens of 27 nations who do not need a visa to enter the US.

"I consider the act absolutely brutal, threatening human rights, violating human dignity, xenophobic and worthy of the worst horrors committed by the Nazis," said Federal Judge Julier Sebastiao da Silva in the court order released on Tuesday.

Brazil currently requires US citizens to have a visa when entering the country.