Mayor Eric Adams’ plan to send more New Yorkers thought to have mental illness to hospitals against their will faced its first legal challenge in federal court Thursday.

The filing, which comes in an ongoing class-action lawsuit, argues that Adams’ policy “discriminates against individuals by treating them differently simply because of their actual or perceived mental disability.”

The filing asks a Manhattan federal judge to halt the directive, which broadens the definition of who the police department and other first responders can commit involuntarily for a psychiatric evaluation.

“The city’s recent announcement is the latest in a long history of failed attempts at reform that only serve to exacerbate these systematic failures,” reads the filing by the firm Beldock Levine & Hoffman, New York Lawyers for the Public Interest and other lawyers.

They argue the initiative violates the Americans with Disabilities Act, among other laws.

Adams’ statements “make clear that city agencies plan to increasingly and aggressively focus on instituting involuntary removals against New Yorkers deemed by police officers to be unable to meet their basic needs, even when no dangerous act has been observed and even if there is no indication of a likelihood of harm to the individual or others,” the filing reads.

The plaintiffs urged the court to quickly intervene.

If the plan is implemented, countless New Yorkers could be subject to “unlawful detention and involuntary hospitalization just for exhibiting behavior perceived by a police officer to be unusual — whether the individual has a mental disability or not,” the lawyers wrote.

Spokespeople from the mayor’s office and the New York City Law Department did not immediately respond to requests for comment.

“This is not a plan, this is disappearing people because you are too incapable of being thoughtful about people that need support,” said Councilmember Carmen De La Rosa in a rally on the steps of City Hall.

The case, filed last year, challenged the NYPD’s handling of “emotionally disturbed persons,” a term the plaintiffs described as “antiquated and offensive.”

Lawyers for the city have moved to have the underlying case dismissed.