Illinois is now the second state to prohibit landlords from evicting tenants solely because they're living in the U.S. illegally.

The measure Democratic Gov. J.B. Pritzker signed into law Wednesday also prohibits landlords from reporting or threatening to report tenants' immigration status to authorities in order to intimidate them, or as retaliation for exercising their rights as tenants, or to force them to move out. The legislation was modeled after a similar law in California.

"Where you were born has absolutely nothing to do with your ability to pay rent on time, which is what the relationship between a landlord and a tenant should really be about," Pritzker said. "And I'm proud that by signing this bill, we're making Illinois the first state in the Midwest to protect our immigrant tenants and give them a little more relief in these tumultuous times."

Pritzker used the signing ceremony at the James R. Thompson Center in the Loop to continue his criticism of President Donald Trump's immigration policies. He blasted recent White House efforts to make it more difficult for immigrants who use public benefits to get green cards and a proposal unveiled Wednesday morning that would allow families that cross the border illegally to be detained indefinitely. The Trump administration has said those policies are necessary to enforce the immigration laws established by Congress.

The governor said he wants Illinois to stand as a "firewall" against a "xenophobic president" who is creating "a climate of fear."

"We're stronger when we offer all of our residents the opportunities to improve their lives and the lives of their children," Pritzker said.

Supporters said the new Illinois law was necessary because some landlords use the threat of notifying immigration authorities to keep tenants from reporting unsafe living conditions or other problems. State Sen. Cristina Castro, an Elgin Democrat and chief sponsor of the legislation, said this type of behavior was previously legal under state law.

"This is essentially a form of blackmail," Castro said. "Quite frankly, it's a shame that this sort of thing even needs to be legislated against."

Previous Republican Gov. Bruce Rauner vetoed an earlier version of the legislation last August, citing concerns that it conflicted with federal law. The new version was approved this spring with a smattering of GOP support and without formal opposition from real estate groups, which opposed the earlier attempt.

Andrew Timms, president of the Illinois Rental Property Owners Association, said his organization of roughly 2,000 landlords "felt as though the earlier version was too broad and that innocent people could get caught up in extremely costly fines and punishments."

"We feel it now targets people who want to use housing as a form of extortion," Timms said. That made it possible for his organization to remain neutral, he said.

The new law doesn't prohibit landlords from enforcing the terms of leases or from evicting tenants for any reason allowed under state or local law.

Activists praised Pritzker for his efforts to protect the rights of immigrants, noting several pieces of legislation he's signed into law since taking office in January. Those measures include laws banning private immigration detention facilities and prohibiting local law enforcement agencies entering into agreements with U.S. Immigration and Customs Enforcement to enforce federal immigration law.

"In Illinois, in response to the times we are living in, we create just laws, laws that protect and laws that respect our humanity," said Sylvia Puente, executive director of the Latino Policy Forum.