Two civil rights groups filed a lawsuit Tuesday challenging a new law in a Dallas suburb that outlaws renting apartments to illegal immigrants, alleging the ordinance violates federal law and forces landlords to act as immigration officers.

The American Civil Liberties Union and the Mexican American Legal Defense and Education Fund filed the suit on behalf of residents and landlords in Farmers Branch, just north of Dallas. It is the third lawsuit brought against the city since the ordinance passed in November.

The lawsuit claims the measure, scheduled to take effect Jan. 12, is so poorly drafted that it excludes even legal immigrants from renting.

"Immigration enforcement must be left to the federal government, not each local municipality," said Lisa Graybill, legal director of the ACLU of Texas. "Otherwise Texas will end up with a patchwork system that is impractical and unenforceable."

Farmers Branch spokesman Tom Bryson said the city will not comment on pending litigation.

On Friday, the owners of three apartment complexes filed a lawsuit asking a federal court to declare the rent law unconstitutional. In another lawsuit filed earlier this month, a Farmers Branch resident alleged that the mayor repeatedly violated the state's open meetings laws to deliberate the ordinances.

The new law calls for property managers or owners to verify the immigration or citizenship status of apartment renters. The City Council also approved resolutions making English the city's official language and allowing authorities to become part of a federal program so they can enforce immigration laws.

Since 1970, Farmers Branch has changed from a small, predominantly white bedroom community with a declining population to a city of almost 28,000 people, about 37 percent of them Hispanic, according to the census.

More than 50 municipalities nationwide have considered, passed or rejected similar laws, but until now that trend hadn't been duplicated in Texas.