The landlords of two Sunset Park buildings forced Latino tenants to prove their legal status when they renewed their leases, attempted to evict them and told them they only wanted white tenants, according to a class-action lawsuit.

Adel and Linda Eskander, who operate Little City Realty LLC and Little Boy Realty LLC, are the landlords of 601 40th St. and 614 40th St., where tenants say they have faced discrimination for years.

The Eskanders, who could not immediately be reached for comment, only required tenants who were “perceived as Latino” to confirm their legal immigration status at the time of lease renewal, according to the suit, which was filed by the Legal Aid Society.

They also brought “frivolous eviction proceedings” against Latino tenants, such as not cashing a check from a resident and then accusing her of not paying rent, the suit says. In cases when they were able to push out the Latino tenants, most of whom had rent-stabilized apartments, the Eskanders increased the rent to illegal amounts and “misrepresented the rent regulatory status,” the lawsuit says.

Adel Eskander also is quoted in the suit as allegedly saying, “I don’t like having Latinos, blacks or Chinese here because they’re sedentary. They never move. I need people to move.”

A judge on Thursday ordered the Eskanders to refrain from any discriminating or harassing behavior toward the plaintiffs — including requiring proof of legal immigration status and refusal to renew a lease — until the next court hearing on March 28, according to court documents provided by the Legal Aid Society.

If the landlords are found to have engaged in any of the practices listed in the lawsuit before the next court hearing, they could face a penalty handed down by the judge, a Legal Aid spokesman said.

The Eskanders were sued for similar behavior in 2003, but after that suit was settled, they continued discriminatory behavior, Legal Aid lawyers said.

While discrimination has been going on for years, the current political climate has heightened the threat to immigrants, said Sunny Noh, the supervising attorney of the Tenant Rights Coalition at the Legal Aid Society.

“People of color have a lot more reason to be intimidated,” she said.

Across the city, there has been an increase in discrimination based on immigration status and national origin, according to the City Commission on Human Rights.

The commission is currently investigating more than 300 claims, and more than 100 of those are specifically in housing, a spokesman said. In 2016, there were 60 new claims of discrimination based on immigration in housing, compared to 22 in 2015.

The commission encourages anyone who believes they are a victim of discrimination or harassment to call 718-722-3131.