President-elect Donald Trump can and should withhold federal funds from U.S. cities that say they will guard illegal immigrants from deportation, political columnist Charles Krauthammer said Wednesday on Fox News' "Special Report."

"It's something that should not be allowed," Krauthammer said. "Democrats have tolerated it. I think Trump would be within his rights to withhold funds, and he should, and the Democrats are making a big bet, and a mistaken one, if they decide that they are going to defy the federal government and what seems to be common sense: control your borders."

Sanctuary cities — those that shield illegal immigrants — "were a scandal before Trump," the columnist added, connecting the issue to civil rights struggles in the 1960s.

"The people who did this in the past were the racists in the South who defied federal authority on civil rights," Krauthammer said. "So now it's in the name of something that appears to be humanitarian."

Chicago Mayor Rahm Emanuel, who declared the Illinois city a sanctuary city, said he did not believe Trump would cut funding, according to The Chicago Tribune.

"They will make a choice that this is not the battle they want to take on because they have bigger fish to fry, mark my words," Emanuel said after a city council meeting.