The mayor of New York City has promised he will sue the US government if Muslims are required under a Donald Trump administration to sign up to a “registry”.

“We will use all the tools at our disposal to stand up for our people,” he said.

“If all Muslims are required to register, we will take legal action to block it,” said the mayor.

“If the federal government wants our police officers to tear immigrant families apart, we will refuse to do it,” he added.

His speech at the Cooper Union, where Abraham Lincoln spoke against slavery in 1860, came shortly after president-elect Trump prompted outrage by suggesting that all Muslims should sign to a registry to reveal their identity and religion, an example of his proposed “extreme vetting” and surveillance measures of Muslims in the US.

Hillary Clinton’s former running mate and Virigina senator Tim Kaine encouraged people to sign his petition to stand against the proposed registry, arguing that citizens deserve equal treatment under the law.

“Singling out entire groups to round up and register is just plain wrong,” he said.

At Cooper Union Mr de Blasio also threatened to step in and help law-abiding New Yorkers who have no legal representation to fight their deportation.

He promised to protect women's healthcare, and to protect LGBT members and ethnic minorities from discrimination.

His remarks come days after refusing to resume with a previous controversial police method of stop and frisk, which was carried out disproportionately on people of colour.

“We won’t trade in neighbourhood policing for racial profiling,” he said.

Mr de Blasio pointed out evidence of hate crimes, both perpetrated by and against Trump supporters, saying violence would not be tolerated.