Updated

A Dallas suburb's ban on apartment rentals to illegal immigrants, an ordinance passed by city leaders and later endorsed in a vote by its residents, is unconstitutional, a federal judge found Wednesday.

Only the federal government can regulate immigration, U.S. District Judge Sam A. Lindsay concluded in his decision.

The city didn't defer to the federal government on the matter, violating the supremacy clause of the U.S. Constitution, which allows for the federal government to pre-empt local laws, Lindsay said.

Bill Brewer, who represented apartment complex operators who opposed the rule, declared victory.

"It's a good day, not just for my clients," Brewer said. "It's a good day for people who are thinking clearly about what is the proper role of municipal governments in the immigration debate."

Representatives for the city said they had anticipated the outcome. The city has no plans to appeal the ruling because it has already stopped pursuing the ordinance and replaced it with another tactic.

"We're disappointed but not particularly surprised," Michael Jung, one of the city's attorneys, said.

The Farmers Branch council passed the ordinance last year. It would have barred apartment rentals to illegal immigrants and required landlords to verify legal status. The rule would have exempted minors and senior citizens from having to prove their immigration status or citizenship.

Families made up of both citizens and undocumented members would have been allowed to renew an apartment lease if they met three conditions: they were already tenants, the head of household or spouse was living legally in the United States, and the family included only the spouse, their minor children or parents.

Residents heavily endorsed the rule a year ago in the nation's first public vote on a local measure to combat illegal immigration.

A group of apartment complex operators, residents and advocates sued Farmers Branch. They alleged the rule was so poorly drafted that it could allow exclusion of legal immigrants and citizens from renting, was difficult to abide by because it didn't provide clear guidance for apartment managers and owners, and improperly tried to turn property managers into policing agents.

Lindsay then blocked Farmers Branch from enforcing the ordinance, a temporary injunction now made permanent by his decision Wednesday.

The rule failed to provide clear guidance that immigration documents were acceptable for proof and didn't explain what was meant by "eligible immigration status," the judge wrote.

The city's attempts to salvage the ordinance faltered because they would have required the court to draft laws, he said. That function is outside the court's duties.

Farmers Branch has given up requiring landlords to verify immigration status and instead plans to implement a rule that would require prospective tenants to get a rental license from the city, which would then ask the federal government for the applicant's legal status before approving it.

Around the country, about 100 cities or counties have now considered, passed or rejected similar laws, but Farmers Branch was the first in immigrant-heavy Texas, according to the Puerto Rican Legal Defense and Education Fund, which tracks the data.