(CNN) The 9th US Circuit Court of Appeals on Friday ruled in favor of the Trump administration, saying the Department of Justice could give preference in awarding grants to cities that would use the money to focus on illegal immigration, as the federal government prepares to seek out undocumented immigrants in raids this weekend.

The City of Los Angeles sued the Department of Justice because it did not receive any funding from the Community Oriented Policing Services grant program, which is aimed at initiatives to build trust between communities and law enforcement agencies. Los Angeles chose "building trust and respect" as its focus area and did not mention illegal immigration in its application because of its policy as a sanctuary city.

The panel of judges ruled that "because DOJ's scoring factors encouraged, but did not coerce, an applicant to cooperate on immigration matters, the panel also rejected Los Angeles's claims that DOJ's use of the factors infringed on state autonomy in a manner that raised Tenth Amendment concerns."

"DOJ did not exceed its statutory authority in awarding bonus points to applicants that selected the illegal immigration focus area," the judges wrote, arguing that "DOJ's determination that the techniques of community policing may be used to address this public safety issue (illegal immigration) was entirely reasonable."

The court's decision comes ahead of Immigration and Customs Enforcement raids scheduled for Sunday in nine major cities, including Los Angeles. City officials have come out against the impending raids -- the Los Angeles Police Department said Thursday that it "does not and will not participate in the enforcement of civil administrative law," and Los Angeles Mayor Eric Garcetti tweeted suggestions Friday for how to deal with ICE agents.

The White House praised the court's decision, saying in a statement Friday that it "reverses a lawless decision that enabled Sanctuary City policies, putting the safety and security of all Americans in harm's way."

"The ruling upholds the right of the Department of Justice to ensure discretionary grants under its control are not being used to subsidize these jurisdictions' open assault on law-abiding Americans and their loved ones," the statement added.

Los Angeles City Attorney Mike Feuer said the city would look at every option, including an appeal to a larger panel of the 9th Circuit, the Los Angeles Times reported Friday.

"If this decision were to stand, this or another administration could add other conditions, favoring jurisdictions that criminalize abortions or allow teachers to have guns in classrooms," Feuer said, according to the LA Times.

Feuer's office did not immediately respond to CNN's request for comment.

President Donald Trump signed an executive order in 2017 seeking to "ensure that jurisdictions that fail to comply with applicable Federal law do not receive Federal funds, except as mandated by law."

Community Oriented Policing Services funds are among those that can be blocked by the President without congressional approval, according to immigration law experts. The grants go toward developing innovative policing strategies and providing training and technical assistance to community members, local government leaders and law enforcement.

Garcetti at the time stood by Los Angeles' status as a sanctuary city, arguing that cutting funding to any city "puts the personal safety and economic health of our entire nation at risk."