The Puerto Rican Legal Defense and Education Fund, among the groups filing suit, called the measure illegal and asked a judge to prevent its enforcement.
Hazleton, a northeastern Pennsylvania city of about 31,000, approved one of the toughest laws of its kind in the United States last month, imposing $1,000 fines on landlords who rent to illegal immigrants, denying business permits to companies that give them jobs and making English the city's official language.
The lawsuit, filed Tuesday in Scranton, contends that the Constitution gives the federal government exclusive power to regulate immigration and that the city's ordinance is discriminatory and unworkable.
"It makes every person who looks or sounds foreign a suspect, including those who are here legally," Witold Walczak, legal director of the American Civil Liberties Union of Pennsylvania, said in a statement. "You might as well just paint a target on every foreigner's forehead or a sign saying, 'Please treat me differently."'
Mayor Lou Barletta said Hazleton would stand its ground.
"They are attempting to scare the city into backing off. It's not going to work. We're not going to be bullied," he said. "We're confident the ordinance will stand up to judicial scrutiny and we'll fight it as far as we have to."
The ACLU and other plaintiffs' attorneys told Barletta that they would drop the lawsuit if City Council repealed the ordinance at its meeting Tuesday night and agreed not to pursue a similar measure in the future.
Instead, Council tentatively approved a substitute ordinance that clarifies some of the language in the original bill but leaves the major provisions in place.
The city's ordinance inspired nearly a dozen local governments in eastern Pennsylvania — and several more throughout the nation — to consider their own laws on illegal immigration. Local officials will watch the Hazleton lawsuit as a test case of their ability to legislate on what has traditionally been a federal matter.
Separately, another group of civil rights activists Tuesday filed a lawsuit against Riverside, N.J., a Philadelphia suburb that passed an ordinance similar to Hazleton's.
Barletta proposed the law in Hazleton after two illegal immigrants were charged with shooting and killing a man. It's not clear how many illegal immigrants live in the city, but its Hispanic population has skyrocketed in recent years. Barletta said the measure has already prompted illegal immigrants to leave.
The Congressional Research Service, a nonpartisan agency that writes reports for lawmakers, said in a recent analysis that federal law likely precludes municipalities from enforcing such measures.
The Puerto Rican Legal Defense and Education Fund, the ACLU and other groups filed the lawsuit on behalf of 11 Hazleton residents and business owners and three nonprofit groups. Among the plaintiffs are landlords who says they lost tenants and a Mexican immigrant who says her grocery store and restaurant have fallen on hard times since the ordinance was passed.
They want a judge to declare the ordinance invalid and assess damages against the city.
Hazleton's law has divided the city 80 miles northwest of Philadelphia, with longtime residents supporting Barletta, but many Hispanics opposed.
Barletta said he has gotten thousands of calls and e-mails from around the country from people backing him, and that hundreds have pledged money to fight a legal battle. The city has set up a Web site to accept donations for its legal bills and several law firms have promised to help out, too, he said.
"I believe this will be a landmark case. A line has been drawn here in Hazleton. This will impact cities all across the country," he said.