Chicago’s days as a “sanctuary city” where undocumented people can access city services and live without fear of police harassment date back more than 30 years.

In 1985, then-Mayor Harold Washington issued an executive order prohibiting city employees from enforcing federal immigration laws. He made the move to protest the federal government’s decision to question people seeking city services and conduct random searches of city records in an effort to find undocumented immigrants.

Four years later, then-Mayor Richard M. Daley affirmed the executive order. In 2006, the City Council turned the order into law as the immigration debate raged on in Congress.

It prohibited city agencies from asking about the immigration status of people seeking city services. The ordinance also prohibited Chicago Police from questioning the immigration status of crime victims, witnesses or other law-abiding citizens.

Despite that city policy, there remained a legal loophole.

When Chicago Police made a stop, ran a criminal background check and found a deportation order, there was no specific standard on what they should do amid mounting pressure from the federal Immigration and Customs Enforcement agency to turn them over.

Mayor Harold Washington first made Chicago a "sanctuary city" in 1985. | Sun-Times file photo

Mayor Harold Washington first made Chicago a “sanctuary city” in 1985. | Sun-Times file photo

As a result, a 54-year-old mother from Cameroon stopped after failing to signal a turn was detained for two nights in 2012 after police found a deportation order on her record.

The case of Rose Tchakounte — who was turned over to ICE, but never deported — became a cause célèbre for the Illinois Coalition for Immigrant and Refugee Rights.

In response, Mayor Rahm Emanuel and U.S. Rep. Luis Gutierrez, D-Ill., united behind a so-called “Welcoming City” ordinance that prohibits police from detaining undocumented immigrants unless they are wanted on a criminal warrant or have been convicted of a serious crime.

“If somebody has a criminal background, I want ’em in jail or out of the city. If you’re an immigrant and you have no criminal background, I don’t want that to be prohibitive from you contacting the police,” Emanuel said then.

RELATED: Emanuel, Gutierrez seek to reassure immigrants fearful of Trump
Brown: Young immigrant Dreamers fear Trump will be a nightmare

“If you see a crime, report it. If you’re a victim, report it. The Police Department is not there as an adjunct of the Immigration Service. If you have a criminal record, that’s different. If you’re a good citizen, immigration status is not a pause button for you to call the Police Department. . . . I can’t be advocating for the community to work with the Police Department if people are [so] worried about their immigration status that they don’t report a crime.”

Gutierrez said then that Emanuel’s ordinance should not be confused with “cuddling up to criminals.” In fact, he argued that lifting the veil of fear that has made illegal immigrants suspicious of police would make it tougher on the gangs that were at the time fueling a 38 percent spike in Chicago homicides.

“Chicago Police have guns and cars and badges and radios, but without the eyes and the ears of the community, they would be lost,” Gutierrez said then.

“This ordinance protects everyone because it allows anyone who witnesses a crime, who knows about criminal activity and anyone who wants to make our city safer to come forward and share that information with police. And if there was ever a time, this is the time to have everyone … participating in fighting crime.”

From a political standpoint, the 2012 news conference was an opportunity for Emanuel to make amends with Gutierrez.

During Emanuel’s days as Barack Obama’s chief of staff, Gutierrez accused Emanuel of standing in the way of immigration reform and being singularly responsible for Obama’s failure to deliver on his campaign promise to Hispanics.

Gutierrez retaliated by endorsing mayoral candidate Gery Chico over Emanuel in the 2011 race for mayor.

When the two men united over the revised ordinance, all was forgiven.

“He’s not chief of staff and he’s not standing in the way. Those are pretty clear differences,” Gutierrez said then.

“I have made a priority the reform of our immigration system. If the mayor of Chicago is going to work toward making Chicago a model city in respect to its treatment of immigrants, then I’m gonna stand with that mayor. The thing that separated us … was immigration during the campaign. The things that’s uniting us after his election is immigration policy.”

Emanuel added: “Luis and I were friends in Congress, remained friends during the campaign. He made his decision [to endorse Chico] and, the moment the campaign was over, he called me and said, ‘Let’s work together in the interest of the city’ and I said, ‘You’re on.'”

Last year, the City Council accused Gov. Bruce Rauner of overstepping his legal authority by trying to temporarily block the flow of Syrian refugees into Illinois in the wake of the terrorist attacks in Paris.

After an emotional debate that harkened back to America’s darkest, most intolerant days, aldermen also unanimously approved a resolution reaffirming Chicago’s status as a “sanctuary city.”

Emanuel’s 2017 budget includes $1 million to create a municipal ID that will help undocumented immigrants to access city services. The so-called “Star Scholarship” to City Colleges already is open to undocumented immigrants. So are after-school and summer jobs programs.