The city of San Francisco and nearby Santa Clara County sued President Donald Trump’s administration on Tuesday, seeking to block a new rule that would drastically reduce legal immigration by denying visas to poor migrants.

Some experts say the new rule could cut legal immigration in half by denying visas and permanent residency to hundreds of thousands of people if they fail to meet high enough income standards or if they receive public assistance such as welfare, food stamps, public housing or Medicaid.

“This illegal rule is just another attempt to vilify immigrants,” San Francisco City Attorney Dennis Herrera said in a statement. Trump has made efforts to curb both legal and illegal immigration, an issue he has made a cornerstone of his presidency and one that he has stressed again as the campaign for the 2020 presidential election heats up.

The rule, unveiled on Monday and to take effect Oct. 15, expands the definition of a public charge, allowing denials to visa applicants who fail to meet income requirements or who receive public assistance.

“The final rule rejects the longstanding, existing definition of public charge, and attempts to redefine it to include even minimal use of a much wider range of non-cash benefits,” said the lawsuit, filed in U.S. District Court in San Francisco.

“The final rule will worsen the health and well-being of the counties’ residents, increase risks to the public health, undermine the counties’ health and safety-net systems, and inflict significant financial harm,” the suit said.

San Francisco is both a city and a county. Santa Clara County includes the city of San Jose and various other parts of Silicon Valley.

The suit names U.S. Citizenship and Immigration Services, the Department of Homeland Security and their directors as defendants. The former agency declined to comment and the latter did not immediately respond to a request for comment.

The suit claims the new rule violates the Immigration and Nationality Act of 1965 by contradicting the longstanding definition of public charge as a person “primarily” dependent on public assistance for survival.

The suit also claims the new rule would split families, undermining immigration laws to prioritize family unification; misapplies the intent of Congress on the description of self-sufficiency of immigrants; and runs contrary to the statutes governing SNAP, also known as food stamps.

The National Immigration Law Center said it also will file a lawsuit to stop the rule from taking effect. The attorneys general of California and New York have also threatened to sue.