CHICAGO, IL - OCTOBER 16:  A mural voicing support for immigrants is painted along a retail strip in the predominately Hispanic Pilsen neighborhood on October 16, 2017 in  Chicago, Illinois. The U.S. Justice Department has accused four cities including Chicago, New York, New Orleans and Philadelphia of violating the law with their "sanctuary city" policies.  (Photo by Scott Olson/Getty Images)
CHICAGO, IL - OCTOBER 16: A mural voicing support for immigrants is painted along a retail strip in the predominately Hispanic Pilsen neighborhood on October 16, 2017 in Chicago, Illinois. The U.S. Justice Department has accused four cities including Chicago, New York, New Orleans and Philadelphia of violating the law with their "sanctuary city" policies. (Photo by Scott Olson/Getty Images)
PHOTO: Scott Olson/Getty Images North America/Getty Images
Now playing
00:48
Judge blocks Trump's sanctuary cities order
President Donald Trump addresses the 73rd session of the United Nations General Assembly, at U.N. headquarters, Tuesday, Sept. 25, 2018. (AP Photo/Richard Drew)
President Donald Trump addresses the 73rd session of the United Nations General Assembly, at U.N. headquarters, Tuesday, Sept. 25, 2018. (AP Photo/Richard Drew)
PHOTO: Richard Drew/AP
Now playing
01:17
Trump to migrants: Make your nations great again
Central American immigrants depart ICE custody, pending future immigration court hearings on June 11, 2018 in McAllen, Texas. Thousands of undocumented immigrants continue to cross into the U.S., despite the Trump administration
Central American immigrants depart ICE custody, pending future immigration court hearings on June 11, 2018 in McAllen, Texas. Thousands of undocumented immigrants continue to cross into the U.S., despite the Trump administration's recent "zero tolerance" approach to immigration policy. (Photo by John Moore/Getty Images)
PHOTO: John Moore/Getty Images
Now playing
01:06
Judge blocks asylum seekers from deportation
PHOTO: Pool
Now playing
01:51
Trump: I prefer shutdown before midterms
CHICAGO, IL - JUNE 29:  Demonstrators hold a rally in the Little village neighborhood calling for the elimination of the U.S. Immigration and Customs Enforcement (ICE) and an end to family detentions on June 29, 2018 in Chicago, Illinois. Protests have erupted around the country recently as people voice outrage over the separation and detention of undocumented children and their parents.  (Photo by Scott Olson/Getty Images)
CHICAGO, IL - JUNE 29: Demonstrators hold a rally in the Little village neighborhood calling for the elimination of the U.S. Immigration and Customs Enforcement (ICE) and an end to family detentions on June 29, 2018 in Chicago, Illinois. Protests have erupted around the country recently as people voice outrage over the separation and detention of undocumented children and their parents. (Photo by Scott Olson/Getty Images)
PHOTO: Scott Olson/Getty Images North America/Getty Images
Now playing
01:30
HHS refusing to release family separation stats
Now playing
01:01
Reporter to Sarah Sanders: Why did Trump lie?
Now playing
01:28
Trump: ICE agents are mean but have heart
PHOTO: Pool
Now playing
01:23
Trump: Our facilities better than Obama's
trump king of jordan visit
trump king of jordan visit
PHOTO: CNN
Now playing
01:15
Trump: No regrets signing executive order
Immigrant children walk in a line outside the Homestead Temporary Shelter for Unaccompanied Children, a former Job Corps site that now houses them, on Wednesday, June 20, 2018, in Homestead, Fla. (AP Photo/Brynn Anderson)
Immigrant children walk in a line outside the Homestead Temporary Shelter for Unaccompanied Children, a former Job Corps site that now houses them, on Wednesday, June 20, 2018, in Homestead, Fla. (AP Photo/Brynn Anderson)
PHOTO: Brynn Anderson/AP
Now playing
01:54
Children in limbo after Trump executive order
Secretary of State Mike Pompeo listens as President Donald Trump speaks during a cabinet meeting at the White House, Thursday, June 21, 2018, in Washington. (AP Photo/Evan Vucci)
Secretary of State Mike Pompeo listens as President Donald Trump speaks during a cabinet meeting at the White House, Thursday, June 21, 2018, in Washington. (AP Photo/Evan Vucci)
PHOTO: Evan Vucci/AP
Now playing
02:18
White House chaos over immigration reversal
Watched by Homeland Security Secretary Kirstjen Nielsen (L) and Vice President Mike Pence, US President Donald Trump signs an executive order on immigration in the Oval Office of the White House on June 20, 2018 in Washington, DC. - US President Donald Trump on Wednesday signed an executive order aimed at putting an end to the controversial separation of migrant families at the border, reversing a harsh practice that had earned international scorn."It
Watched by Homeland Security Secretary Kirstjen Nielsen (L) and Vice President Mike Pence, US President Donald Trump signs an executive order on immigration in the Oval Office of the White House on June 20, 2018 in Washington, DC. - US President Donald Trump on Wednesday signed an executive order aimed at putting an end to the controversial separation of migrant families at the border, reversing a harsh practice that had earned international scorn."It's about keeping families together," Trump said at the signing ceremony. "I did not like the sight of families being separated," he added. (Photo by Mandel Ngan / AFP) (Photo credit should read MANDEL NGAN/AFP/Getty Images)
PHOTO: MANDEL NGAN/AFP/Getty Images
Now playing
02:49
What's next after Trump's policy reversal?
Trump meeting 06202018
Trump meeting 06202018
PHOTO: POOL
Now playing
02:33
Trump reverses position on family separations
President Donald Trump signs an executive order to keep families together at the border, but says that the
President Donald Trump signs an executive order to keep families together at the border, but says that the 'zero-tolerance' prosecution policy will continue, during an event in the Oval Office of the White House in Washington, Wednesday, June 20, 2018. Standing behind Trump are Homeland Security Secretary Kirstjen Nielsen, left, and Vice President Mike Pence. (AP Photo/Pablo Martinez Monsivais)
PHOTO: Pablo Martinez Monsivais/AP
Now playing
01:52
Trump signs executive order to end family separations
PHOTO: CNN
Now playing
01:18
Trump: Take children away to prosecute parents
THE PRESIDENT meets with the National Space Council  In-House Pool (Pre-set 9:30AM | Final Gather 11:15AM -- Palm Room Doors)
THE PRESIDENT meets with the National Space Council In-House Pool (Pre-set 9:30AM | Final Gather 11:15AM -- Palm Room Doors)
PHOTO: Pool
Now playing
01:40
Trump: The US will not be a migrant camp

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.

The January order sought to crack down on jurisdictions such as Chicago, New York, Los Angeles and San Francisco that do not comply with Immigration and Customs Enforcement (ICE) requests for assistance with identifying and deporting undocumented immigrants.

It was not immediately clear whether the Trump administration was preparing to appeal the ruling, but the Justice Department said it plans to “vindicate the President’s lawful authority to direct the executive branch.”

“The District Court exceeded its authority today when it barred the President from instructing his cabinet members to enforce existing law,” Justice Department spokesman Devin O’Malley said in the statement.

Attorney: Ruling a victory for rule of law

 A mural voicing support for immigrants is painted along a retail strip in the Pilsen neighborhood of  Chicago.
A mural voicing support for immigrants is painted along a retail strip in the Pilsen neighborhood of Chicago.
PHOTO: Scott Olson/Getty Images North America/Getty Images

Those fighting the executive order celebrated the decision Monday.

“This is a victory for the American people and the rule of law,” San Francisco city attorney Dennis Herrera said in a statement. “This executive order was unconstitutional before the ink on it was even dry.

“We live in a democracy. No one is above the law, including the president.”

The statement added that he was “grateful that we’ve been able to protect billions of dollars that help some of the most vulnerable Americans.”

What is a sanctuary city?

The term “sanctuary city” is a broad term applied to jurisdictions that have policies in place designed to limit cooperation with or involvement in federal immigration enforcement actions.

Cities, counties and some states have a range of informal policies as well as actual laws that qualify as “sanctuary” positions.

Most of the policies center around not cooperating with federal law enforcement on immigration policies. Many of the largest cities in the country have forms of such policies.

In 2015, more than 200 state and local jurisdictions did not honor requests from Immigration and Customs Enforcement to detain individuals, ICE Director Sarah Saldaña testified before Congress, and a subset of that group refused to give access to their jails and prisons to ICE.

According to tracking by the Center for Immigration Studies, a think tank that advocates for restricting immigration and opposes sanctuary policies, roughly 300 sanctuary jurisdictions rejected more than 17,000 detention requests, between January 1, 2014 and September 30, 2015.

The idea for sanctuary cities appears to have sprung out of churches in the 1980s that provide sanctuary to Central Americans fleeing violence at home amid reluctance by the federal government to grant them refugee status.

They became popular in more diverse locales to counter what officials there saw as overzealous federal immigration policies, particularly against those arrested for minor, non-violent crimes.

“San Francisco is a sanctuary city and will not waiver in its commitment to protect the rights of all its residents,” San Francisco Mayor Edwin Lee said in January, upon announcing an expansion to a city fund to provide legal services to the immigrant community, documented or otherwise.

Chicago has set up a similar fund, as has Los Angeles.

“Chicago has in the past been a sanctuary city,” Mayor Rahm Emanuel said in November, according to the Sun-Times. “It always will be a sanctuary city.”

Case that sparked immigration debate

The murder trial of an undocumented immigrant has drawn national attention – in part because he had been deported from the United States five times.

Jose Ines Garcia Zarate’s trial for the shooting of Kate Steinle, on a San Francisco pier in July 2015, stirred the already heated debate over immigration.

The case became a rallying cry for Trump and GOP politicians, who have invoked Steinle’s name in decrying sanctuary cities and promoting the construction of a border wall.

Before the shooting, officials in San Francisco had released Garcia Zarate from custody instead of turning him over to immigration authorities.

CNN’s Tal Kopan, Dan Simon and Darran Simon contributed to this report.