Story highlights The order blocks a key executive order

Trump signed the order soon after taking office

(CNN) President Donald Trump's latest executive order aimed at implementing the hardline immigration policies he championed during his campaign has been blocked by a federal court.

US District Court Judge William Orrick issued a permanent injunction Monday blocking Trump's executive order seeking to strip so-called sanctuary cities of federal funding.

The ruling represents a major setback to the administration's attempts to clamp down on cities, counties and states that seek to protect undocumented immigrants who come in contact with local law enforcement from deportation by federal authorities.

The ruling was also the latest instance in which a federal judge has stood in the way of Trump's effort to implement his hardline policies immigration, joining rulings that have blocked different portions of Trump's travel ban and preliminary injunctions on the sanctuary cities order.

Monday's ruling, which followed lawsuits from two California counties, nullifies Trump's January executive order on the matter, barring the administration from setting new conditions on spending approved by Congress.

Read More