Chicago will remain a sanctuary city despite President Donald Trump's promise to withhold federal funds from cities that protect undocumented immigrants from deportation, Mayor Rahm Emanuel said. View Full Caption DNAinfo/Lizzie Schiffman

THE LOOP — President Donald Trump signed an executive order Wednesday outlining a plan to crack down on cities that protect undocumented immigrants from deportation that could cost Chicago millions of dollars.

"Jurisdictions that willfully refuse to comply [with federal immigration laws] are not eligible to receive federal grants except as deemed necessary for law enforcement purposes," according to the order signed by Trump Wednesday.

"We are going to get the bad ones out, the criminals and the drug leaders and gangs and gang leaders," Trump said Wednesday at a televised rally to announce the order as well as one ordering that a wall be built along the southern border of the United States in an effort to "save thousands of lives, millions of jobs and billions and billions of dollars."

Mayor Rahm Emanuel remained defiant Wednesday.

"We're going to stay a sanctuary city," Emanuel said. "Wherever you came from, you're welcome here."

The order also requires federal officials to publish a weekly list of crimes committed by undocumented immigrants in cities where they are not turned over to federal authorities.

In addition, Trump ordered officials to hire 10,000 more immigration enforcement officers.

It is unclear what the order would mean for Chicago's budget, or whether it will be approved by Congress.

Emanuel predicted Trump would never take this action — telling the news media Nov. 16 that he expected him to find "other priorities" once in the White House.

The Trump administration has taken no action to end the program started by former President Barack Obama that gave legal status to immigrants who came to America as children, known as "dreamers."

Emanuel on Wednesday again called for Trump to take no action that would cause those immigrants to be deported.

"There shouldn't be a bait-and-switch," Emanuel said.

Emanuel declined to speculate how much money Chicago stands to lose for being a sanctuary city, nor has he said how he would fill the hole that such a move could put in the city's budget.

"My next move is to look at the details of the order," Emanuel said.

At almost the same time that the news of the president's action broke, the City Council voted to reaffirm its status as a sanctuary city, a move that has no force of law.

Several aldermen said they were prepared to stand up to the president.

An analysis by the Center for Tax and Budget Accountability, a Chicago-based bipartisan think tank, said Trump would need Congress' approval to yank all of the city's federal funding, which is expected to total $1.3 billion, about 14 percent of its 2017 budget.

That would likely prompt a court challenge on the basis that federal law prohibits officials from putting "strings on a particular federal grant if they have nothing to do with what the grant pays for," according to the center's analysis.

It is far more likely that the federal government would pull all funding related to immigration and law enforcement, which would total $78 million in 2017 — or less than 1 percent of the budget, according to the center's analysis.

However, some legal scholars said the Trump administration could also try to yank funding from the Chicago Public Schools and the CHA, which are governed by boards appointed by the mayor.

Chicago's status as a sanctuary city dates to 1985, when Mayor Harold Washington prohibited city agencies from asking people about their immigration status, though the Chicago Police Department runs background checks on criminal suspects.

Trump made immigration a central issue of the presidential campaign. He has vowed to build a wall between the U.S. and Mexico, to deport 11 million undocumented immigrants and to ban Muslims from entering the United States.

There are 37 sanctuary cities in the United States, including New York, San Francisco, Los Angeles and all of the nation's biggest cities.

Included in the mayor's proposed 2017 budget is $1 million to establish a municipal identification card for undocumented immigrants.