San Francisco is attempting to block US President Donald Trump's executive order cutting federal funding to so-called sanctuary cities.

The Republican president's order would prevent cities that protect undocumented immigrants from receiving federal funding. San Francisco argued that the order could not be carried out without the approval of Congress and asked a federal judge on Friday (14 April) to block its enforcement.

In written briefs seen by The Hill, lawyers for San Francisco said: "Any restriction on eligibility for federal funds must be imposed – clearly, unambiguously, and in advance – by Congress.

"San Francisco is safer when all people, including undocumented immigrants, feel safe reporting crimes."

Sanctuary cities restrict the contact between police and federal immigration authorities, a contact Trump argues is necessary to fight undocumented immigration. He made a crackdown on undocumented immigrants one of his campaign promises.

San Francisco and neighbouring Santa Clara county have asked Judge William Orrick to block the executive order.

In particular, the city and the county have argued against the order's request for police to detain undocumented immigrants serving jail time for an additional 48 hours after serving their sentence.

The plaintiffs have argued that such a move would violate the constitutional rights of prisoners. City ordinances prevent police from telling immigration officials ahead of time about the release of an undocumented immigrant, NBC News reported.

However, lawyers for the Justice Department claimed there was no case because no federal funding cuts had taken place as yet.

They said: "San Francisco does not claim the loss of any federal funds or, for that matter, contend that any action has been taken against it.

"The city does not even allege that such action has been threatened."