NEW YORK (Reuters) - A New York state court on Tuesday temporarily stopped New York City from destroying the personal records of hundreds of thousands of municipal I.D. card holders after Republicans argued the records might be needed to track criminals.

Seeking to protect illegal immigrants who fear deportation under a President-elect Donald Trump administration, city officials had been considering destroying the information and said on Tuesday they would stop collecting it starting next month.

Two Republican state lawmakers sued the city on Monday to block any plans to discard the records collected so far, saying they could be needed to investigate individuals who obtained the cards under false pretenses.

A state judge will decide whether to extend the stay after both sides file additional court papers by Dec. 21.

The city’s IDNYC program, the largest of its kind in the United States, is aimed in part at helping New Yorkers without legal status secure IDs in order to open bank accounts, visit medical facilities and cash a check.

The city has kept copies of documents such as foreign birth certificates and passports that were submitted by more than 800,000 cardholders since the program’s launch in 2014.

Immigration advocates have previously expressed concern that the information could be used to identify and deport illegal immigrants if obtained by the U.S. government.

Trump’s hardline views on illegal immigration, including pledges to deport millions of undocumented people, animated much of his campaign. His choice for U.S. attorney general, Senator Jeff Sessions of Alabama, is known as one of the staunchest anti-illegal immigration members of Congress.

The New York law contained a “kill switch” of sorts: a sunset provision letting the city change its data retention policy by the end of 2016. A city councilman said last year that the language was included specifically in case a conservative Republican won the 2016 presidential election.

Mayor Bill de Blasio, a liberal Democrat, has repeatedly vowed since Election Day to protect the city’s estimated 500,000 illegal immigrants and said the city would not turn over the information if requested. Several other big city mayors have said they will not help authorities find illegal immigrants, despite a threat from Trump to cut off federal funding.

Earlier on Wednesday, Chicago Mayor Rahm Emanuel met with Trump and presented a letter signed by mayors of the largest U.S. cities urging the president-elect to retain a program that lets young illegal immigrants stay in the country.