Get breaking news alerts and special reports. The news and stories that matter, delivered weekday mornings.

The Trump administration's decision to bar New Yorkers from enrolling or re-enrolling in Global Entry and other federal Trusted Traveler Programs is unlawful, unconstitutional and discriminatory, New York state officials charged in a federal lawsuit Monday.

"The Trump administration's new policy not only negatively impacts travelers, workers, commerce and our economy, but it jeopardizes public safety," state Attorney General Letitia James said. "No one should ever use our nation's security as a political weapon, let alone the commander in chief."

The Department of Homeland Security announced last week that it was suspending New Yorkers' ability to enroll in Global Entry and other Trusted Traveler Programs, including FAST and NEXUS.

The decision was announced the day after President Donald Trump criticized "New York's sanctuary policies" in his State of the Union address.

Acting Homeland Security chief Chad Wolf said the suspension was because of New York's so-called Green Light law, which allows New Yorkers over the age of 16 to apply for non-commercial driver's licenses or learner's permits regardless of their citizenship or legal status in the United States. It also prevents Immigration and Customs Enforcement and Customs and Border Protection from accessing information in the state's Department of Motor Vehicles database without a court order or a judicial warrant.

James said the president, a New York native, is "punishing New York for passing its own laws."

Let our news meet your inbox. The news and stories that matters, delivered weekday mornings. This site is protected by recaptcha

"This is a full-on attack on New York's rights as a sovereign state," she said.

Calling the ban "political retribution," the suit said the state's standard driver's licenses have nothing to do with the federal travel program, which holds that applicants must "hold valid, machine-readable passports, lawful permanent resident cards, 'or other appropriate travel document[s]'" and be U.S. citizens, nationals, lawful permanent residents, or citizens of a partner country.

Eligibility involves a sweeping background check and "does not hinge on an applicant possessing a state driver's license," the suit said.

The federal action bans 80,000 New Yorkers who have applications pending from getting clearance, and will also impact 175,000 New Yorkers whose Global Entry memberships expire this year and need to re-enroll.

The "consequences will ripple throughout the state. Congested lines at New York's airports and border crossings will strain resources at the border and undermine safety for all travelers. New York's economy will suffer as wait times at border crossings increases, employers doing global business are placed at a competitive disadvantage, and residents who rely on cross-border travel lose access to these programs," the suit said.

It seeks a court order declaring the ban unconstitutional, charging that New York has been unfairly — and unlawfully — singled out.

Download the NBC News app for breaking news and politics

"More than a dozen states allow undocumented immigrants to obtain driver's licenses, and dozens of other state and local jurisdictions have enacted legislation or adopted policies limiting information-sharing with the federal government's immigration enforcement efforts," the suit said. "Singling out one state for coercion and retribution as a means to compel conformity with preferred federal policies is unconstitutional."

Wolf tweeted Sunday that the action "has nothing to do with illegal aliens receiving drivers licenses. NY is the ONLY state to shut off CBP access to DMV records used for law enforcement purposes in our homeland security mission. Without access, CBP cannot vet Trusted Traveler applicants. It's that simple."

New York Gov. Andrew Cuomo said Friday that Homeland Security does not need access to state motor vehicle records for the travel programs.

"When you go for this clearance, you present yourself to a federal official, you have to go in person and provide the information to the federal government," he said. "They ask you for documents, they interview you and then they decide. They don't have to go to a DMV database."

He called the federal action "an abuse of power. It's extortion. It is hurting New Yorkers to advance their political agenda and we're going to fight back."