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.
The town has scrapped this policy and will be implementing a new one:
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.