New York and 14 other states sued President Donald Trump Wednesday over his plan to end an Obama-era, temporary amnesty program that protects people who are in the United States illegally from being deported.

The lawsuit, filed in U.S. District Court in Brooklyn, seeks to preserve former President Barack Obama’s 2012 executive order creating the Deferred Action for Childhood Arrivals program, or DACA.

“When bullies step up, you have to step to them and step to them quickly,” New York Attorney General Eric T. Schneiderman, a Democrat, said at a news conference at the John Jay College of Criminal Justice in Manhattan.

The 58-page lawsuit — in which New York is the first named plaintiff and is joined by Massachusetts, Connecticut, Delaware and North Carolina, among others — challenges what it refers to as the “illegal actions of the president and the federal government.”

The White House did not immediately return a message seeking comment.

Schneiderman said Trump’s order reversing the program would harm schools, employers, the local economy and other interests and is unlawfully driven by the president’s “anti-Mexican, anti-Latino bias.” Schneiderman said the Trump reversal, announced Tuesday but not effective for six months, is unconstitutional because it would disproportionately harm Latinos.

advertisement | advertise on newsday

Mark Krikorian, executive director of the Center for Immigration Studies, which wants less immigration, said “what the president says or doesn’t say, his supposed animus, has nothing to do with the legality of this program.”

“There can’t be disparate impact, because the same percentage of Hispanics who got DACA will lose DACA,” Krikorian said.

He pointed to a 2011 statement in which Obama said suspending deportations through executive order “would not conform with my appropriate role as president.”

DACA applies to immigrants who are living in the United States unlawfully, came to the country before their 16th birthday, were younger than 31 before 2012, haven’t been convicted of a felony or major misdemeanors, and are in school, graduated from school or are honorably discharged veterans of the armed forces or Coast Guard.

The program, which Trump challenged Congress to salvage with legislation, grants the immigrants the legal permission to travel and work. Until Trump announced the program’s suspension, qualified immigrants could apply for the temporary amnesty.

There are about 800,000 people covered under the program. There are about 42,000 New Yorkers in the program.