Chicago landlords would be required to deadlock front and rear doors and provide access to inside units only to those with a “valid judicial search warrant” under a crackdown aimed at shielding immigrants living in fear of deportation.

North Side Aldermen Deb Mell (33rd) and Carlos Ramirez-Rosa (35th) joined forces on the latest in a series of efforts aimed at protecting immigrants who suffered yet another body blow this week when President Donald Trump moved to phase out legal protection for 800,000 immigrant children know as Dreamers.

Their ordinance introduced at Wednesday’s City Council meeting would essentially declare Chicago apartment buildings as sanctuary buildings off-limits to federal Immigration and Customs Enforcement agents.

“It is declared to be against public policy of the city for a landlord to take any action based on the immigration or citizenship status of a tenant, prospective tenant occupant or prospective occupant,” the ordinance states.

“The landlord may provide law enforcement access to a tenant’s dwelling unit only when law enforcement agents present a valid judicial search warrant. Law enforcement agents, including those seeking to enforce immigration orders, must present a valid judicial search warrant to enter a dwelling unit without express consent of the unit’s lessor.”

Landlords would be barred from making “any inquiry based on the immigration status of a tenant” or applicant. Nor could they require tenants or applicants to “make any statement, representation or certification concerning his or her immigration or citizenship status.”

It would also be illegal to “threaten to disclose the immigration or citizenship status of a tenant, occupant or other person known to the landlord to be associated with a tenant or occupant.”

The ordinance would also impose new and potentially costly financial burdens on Chicago landlords.

“Landlords must equip all centrally-accessible front and rear entrance doors of multiple-dwelling buildings … with deadlock latches,” the ordinance states. “The deadlocking latch must automatically engage once the door is shut and can only be opened from the outside with a key. From the inside, it must be opened by turn knob or handle only.”

Ramirez-Rosa said the protections are needed to stop a “tactic” used by the Trump and Obama administrations to round up illegal immigrants across the nation.

“They go into large apartment buildings in immigrant neighborhoods and, once they gain access to the building, they will go door-to-door and ask everyone about their immigration status,” Ramirez-Rosa said.

“The only way President Trump can achieve record deportations [and his goal of] three million people in four years is with collateral deportation. ICE claims they’re looking for one individual, but once they’re in an apartment building, they try and get as many people in that building as they can.”

The ordinance was introduced on the same day State Sen. Daniel Biss, a Democratic candidate for governor, dropped the rookie alderman as his running mate over Ramirez-Rosa’s support for the movement to punish and isolate Israel with “Boycott, Divest and Sanction.”

Earlier this week, Mayor Rahm Emanuel introduced a City Council resolution urging Gov. Bruce Rauner and the Illinois General Assembly to establish an Illinois Dreamers Bill of Rights. The governor declined, insisting the issue is one Congress must resolve.

During the emotional debate, Ramirez-Rosa accused Trump of following up the “hateful rhetoric” he used to get elected “with action.” He also turned up the heat on Emanuel by demanding that the city “meet Donald Trump’s action with our own.”

“Move forward on removing the carve-outs from the welcoming city ordinance so that we are truly a sanctuary city that protects everyone,” Ramirez-Rosa said.

“Move forward with addressing abuses occurring against black people by the police so that we are truly a sanctuary city that is protecting everyone,” he added, saying the ordinance “will protect immigrants from raids and strengthen protection for tenants.”

Currently, Chicago Police officers are permitted to cooperate with Immigration and Customs Enforcement if targeted individuals are: in the city’s gang database; have pending felony prosecutions or prior felony convictions; or are the subject of an outstanding criminal warrant.

For months, immigrant activists, the Black Youth Project Hispanic aldermen and the ACLU have been pressuring Emanuel to remove all of those so-called “carve-outs.”

Asked later about the propriety of targeting individuals in the city’s gang database, Emanuel said: “We use it in the proper way to do what we need to do for the safety of our streets.”