The move escalated the Trump administration’s battle with cities and states over immigration enforcement, and it took New York officials by surprise. There were no negotiations between Mr. Cuomo and federal authorities; state officials only learned of the ban on Wednesday night.

“They never called, they never had a conversation,” Mr. Cuomo said.

The decision by Homeland Security affects New Yorkers who use Trusted Traveler programs like Global Entry; their renewals will be cut off by the end of 2020. About 50,000 New Yorkers in the application process but who haven’t received final approval will also lose the opportunity to speed through security but will be reimbursed for their application fees, according to Heather Swift, a spokeswoman for Homeland Security.

In addition to airports, specific lanes to quickly cross over the land border — available to those in the FAST, NEXUS and SENTRI programs — are also covered by the new rules, which were announced in a letter to the New York State government from Chad F. Wolf, the acting secretary of Homeland Security. That, too, could inconvenience state residents and commercial truck drivers, who frequently cross back and forth into Canada.

Ms. Swift said if New York granted the agency access to the database, the suspension would be lifted. “This is not about granting licenses to illegal aliens,” she said.

Fifteen states and the District of Columbia have passed so-called green-light laws allowing undocumented immigrants to obtain driver’s licenses, according to the National Conference of State Legislatures; they include solidly Democratic states like Washington and California, and conservative bastions like Utah.

Supporters of New York’s law championed it as one of the strongest in its protection of personal information, including photos, from federal immigration officials. (New Jersey passed a similar law in December, also limiting federal authorities’ access of Department of Motor Vehicles data, but it does not go into effect until next year.)