US border officials have arrested nearly 500 undocumented immigrants during a four-day operation.

The 498 people held were living in so-called 'sanctuary cities', where local governments do not as a matter of policy cooperate fully with the federal government's US Immigration and Customs Enforcement (ICE) department.

These jurisdictions refuse to hand over undocumented immigrants to the ICE unless there is proof they have committed a serious crime, while others avoid having to enforce federal law by allowing their civil servants to ask people about their immigration status.

Some of the biggest cities in the US are sanctuary cities, including New York, Los Angeles, San Francisco, Washington DC, Chicago, Dallas, Houston, and Detroit.

The arrests are part of the Trump administration's sweeping crackdown on the estimated 12 million people living in the US illegally.

The US president and his attorney general, Jeff Sessions, have made abolishing sanctuary cities a key focus of the administration. In April, sanctuary cities started receiving letters warning about funding cuts if they refused to provide the immigration statuses of people held in their custody. So far courts have blocked any attempts to withhold funds, describing the move as "unconstitutional".

The ICE said its "safe city" operation targeted people who had violated immigration laws, especially those with criminal convictions, gang affiliations or who have re-entered the country after being deported.

Those recently arrested came from 42 countries. More than 300 of them had criminal convictions, according to the ICE. The most common offence was drink driving, for which 90 people had been convicted.

Talia Inlender, a senior staff attorney at Public Counsel, the largest US law firm advocating for immigrants, condemned the government for targeting sanctuary cities.

"It's clearly a political move that is not actually geared toward public safety," she said.