ALLENTOWN, Pennsylvania (CNN) -- A federal court Thursday struck down ordinances passed by Hazleton, Pennsylvania, that were intended to limit where illegal immigrants could live and work.
A bar in Hazleton, Pennsylvania, displays a sign on Thursday that reads "ALL Legals Served."
Last year, Hazleton passed the Illegal Immigration Relief Act Ordinance, which would have fined landlords who rented to undocumented immigrants and would have penalized companies that employed them.
Under another law, tenants would have had to prove they were citizens or lawful residents, register with the city and pay for a rental permit in order to receive an occupancy permit.
The ordinances were copied by other cities.
The court ruled that Hazleton cannot enact any ordinances dealing with illegal immigration because they conflict with the supremacy clause of the U.S. constitution.
"Hazleton, in its zeal to control the presence of a group deemed undesirable, violated the rights of such people, as well as others within the community. Since the United States Constitution protects even the disfavored, the ordinances cannot be enforced," U.S. District Judge James M. Munley wrote in the 206-page opinion.
Mayor Lou Barletta, who spearheaded the opposition, said he will appeal the ruling. "This fight is far from over," he told reporters outside the courtroom. "Hazleton is not going to back down. ... We will take it all the way to the Supreme Court if we have to." Watch mayor decry "injustice" »
Barletta drafted the act last year after "a high-profile murder, the discharge of a gun at a crowded city playground, and drug busts" allegedly involving illegal immigrants, he wrote on his Web site, www.smalltowndefenders.com.
"Illegal aliens in our city create an economic burden that threatens our quality of life," he wrote. "With a growing problem and a limited budget, I could not sit back any longer and allow this to happen. I needed to act!"
Hazleton's population was 23,000 in 2000. Since then, it has risen to an estimated 30,000 to 33,000, with many of the newcomers being Mexican immigrants, according to Munley.
The American Civil Liberties Union of Pennsylvania was among several groups that filed the suit on behalf of Hazleton residents, landlords and business owners.
The groups contended that only the federal government has the right to regulate immigration or to deprive residents of the rights to equal protection. In addition, they said, the ordinances violated state and federal housing laws.
The ordinances, Munley said, "penalize landlords, tenants, employers and employees without providing them the procedural protections required by federal law, including notice and an opportunity to be heard."
"Our analysis applies to illegal aliens as well as to legal residents and citizens. The United States Constitution provides due process protections to all persons," he wrote, emphasizing "all."
The city exceeded its police powers by enacting unconstitutional ordinances, wrote Munley, whom President Clinton appointed to the federal bench in 1998.
Barletta said he would "continue to fight for the people of this community and other cities around the country."
"It's almost amusing to me that the judge would say we can't do what the federal government should be doing, when in fact the federal government is not doing their job," he told CNN's Lou Dobbs.
A spokesman for the ACLU of Pennsylvania expressed satisfaction with the ruling.
"Hazleton-type laws are designed to make life miserable for millions of immigrants," said Vic Walczak, legal director for the group and a lead attorney in the case. "They promote distrust of all foreigners, including those here legally, and fuel xenophobia and discrimination, especially against Latinos."