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.