ALBANY, N.Y. — Five months after it kicked New Yorkers out of trusted traveler security programs in a spat over immigration policy, the U.S. Department of Homeland Security reversed itself Thursday and told a court it had misrepresented the facts in a lawsuit over the matter.

The department announced that New Yorkers would once again be allowed to enroll and re-enroll in Global Entry and other federal travel programs that allow vetted travelers to avoid long security lines at airports and the U.S. border.

President Donald Trump's administration in February booted New Yorkers from the programs, saying it was taking the action because a newly enacted state law allowing unauthorized immigrants to get driver's licenses had cut off some federal access to state motor vehicle records.

In its announcement Thursday, Homeland Security said it was reversing New York's expulsion from the program because the state legislature in April had amended the law to allow federal officials to access the records of people applying for trusted traveler status.

But in a court filing later Thursday, attorneys for the U.S. attorney's office in Manhattan, which had been representing the Department of Homeland Security in the legal fight over the state's expulsion, disclosed that federal officials had also misled the court about some key facts in the dispute.

The Trump administration had claimed that New York's policy limiting access to criminal history information found in motor vehicle records was unique among the states, and made it impossible to determine whether someone qualified for trusted status.

In truth, several states plus Washington D.C. also don't provide access to driving history information, the lawyers wrote. And yet all of those states, including California, were allowed to remain in the program.

"Defendants deeply regret the foregoing inaccurate or misleading statements and apologize to the Court and plaintiffs for the need to make these corrections at this late stage in the litigation," the government attorneys wrote.

They also asked the judge to permit them to withdraw motions and briefs that sought dismissal of the lawsuit, filed by New York Attorney General Letitia James, and informed the court that New Yorkers were being let back into Trusted Traveler programs "effective immediately."

James said in a statement that the removal of the ban was "a victory for travelers, workers, commerce, and our state's economy."

The announcement comes at a time when international travel has been severely curtailed because of the pandemic, and a number of countries have barred U.S. travelers because of the high number of cases in the country.

Gov. Andrew Cuomo, who met with Trump at the White House to try to allow New Yorkers to rejoin the program and restart the importation and exportation of vehicles, said the fix protected New Yorkers' privacy while addressing federal concerns.

"I am glad that this issue has finally been resolved for all New Yorkers," he said.

In its announcement that the state was being readmitted to the program, DHS officials said New York's amended law, while restoring some federal access, is still "antithetical" to the agency's mission and data access policies.

"Nonetheless, local New York law continues to maintain provisions that undermine the security of the American people and purport to criminalize information sharing between law enforcement entities," Acting Secretary Chad Wolf said.