A U.S. appellate court on Saturday ruled the hundreds of national guard troops sent to Chicago can remain in Illinois but cannot be deployed, largely upholding a lower court's halt on the mobilization by President Donald Trump as part of his mass deportation campaign.

"It is ordered that appellants' request for an administrative stay is granted as to the federalization of the National Guard and denied as to the deployment of the National Guard," said the ruling by the U.S. Court of Appeals for the Seventh Circuit.

The Trump administration had appealed the lower court ruling issued Thursday, arguing the troops are necessary to protect immigration agents and facilities in America's third-largest city.

The appellate decision allows the deployment of troops to remain paused until the court can hear further arguments.

The deployment in Chicago involves 200 national guard troops from Texas and 300 from Illinois, according to U.S. Army Northern Command, with an initial mobilization period of 60 days.

As for a similar troop deployment in Democratic-ruled Portland, Oregon, a three-member appeals court panel was weighing whether to lift another judge's temporary block of the mobilization.

Illinois and Oregon are not the first states to file legal challenges against the Trump administration's extraordinary domestic use of the national guard.

They follow in the footsteps of California — another state largely run by Democrats — which sued the Trump administration after the national guard was deployed in Los Angeles earlier this year.

Federal authorities said the deployment was done to quell demonstrations sparked by sweeping raids on undocumented migrants, but local and state leaders called it an unnecessary escalation of force.

Like in other U.S. cities, raids by Immigration and Customs Enforcement (ICE) agents in Chicago have sent a chill through Latino communities, with activist groups warning residents about sweeps in neighborhoods like Cicero, Little Village and Pilsen.

"You may not see a raid, but this is affecting our community," said Casey Caballero, 37, a self-described soccer mom who is married to a naturalized U.S. citizen.

Recent protests at an ICE facility in the Chicago suburb of Broadview have led to protesters being beaten, tear-gassed and arrested.