A Manhattan federal judge Tuesday said he may unseal FBI affidavits seeking a search warrant for Hillary Clinton’s emails in the Anthony Weiner investigation, giving the government two days to argue why the materials that shook up the presidential election should stay secret.

U.S. District Judge P. Kevin Castel, acting on a suit filed by a lawyer who specializes in repatriating art looted by the Nazis, said materials related to FBI Director James Comey’s dramatic October announcement renewing his e-mail probe of Clinton no longer need to stay secret to protect the underlying sexting probe of Weiner.

“Director Comey described that as an unrelated investigation,” Castel told Justice Department lawyer Jennie Kneedler. “ . . . It appears to me that in the case of Secretary Clinton, she has been identified by name, and . . . Director Comey seems to indicate that investigation is now completed.”

After a lengthy probe of whether Clinton mishandled classified information through her private e-mail server was closed without charges last summer, Comey shook up the presidential race in late October by announcing that the FBI had come across Clinton e-mails in its probe of ex-Congressman Weiner’s possible sexting with a young girl.

The Weiner probe was being conducted by the office of Manhattan U.S. Attorney Preet Bharara, and the emails in question were reportedly contained on a laptop used by Weiner and his wife, Clinton aide Huma Abedin.

A few days before the election, Comey announced that the new emails had been reviewed, and did not require reopening the Clinton e-mail probe or change the conclusion that no charges were merited. But Clinton’s camp contends his October announcement was improper, and critically changed the trajectory of the presidential race toward Donald Trump.

advertisement | advertise on newsday

Castel, who did not issue the warrant, said he knew “literally nothing” about the substance of the FBI warrant application. He ordered lawyers to notify Weiner, Abedin and Clinton so they can be heard, and said he wanted to act quickly — telling Kneedler to suggest redactions to protect third parties by 5 p.m. Thursday in case he unseals the materials.

Kneedler said the Justice Department opposes unsealing, but she couldn’t freely discuss the substance of the case in open court.

“I’m limited in what I can say here to you,” she told Castel. “There are things we would like to make your Honor aware of . . . about why plaintiff cannot establish a common law right of access.”

E. Randol Schoenberg, the Los Angeles lawyer who filed the lawsuit, said he thought Comey’s announcement played a critical role in the outcome of the election, and it was important for the public to know what — if any — basis the FBI had for believing the emails were suspect.

“The public has a right to a transparent process,” said Schoenberg, whose work to recover stolen art was the focus of “Woman in Gold,” a 2015 film. “If a mistake was made we have a right to find out and hold people accountable, and if someone improperly influenced the process we have a right to follow that and see where that path leads.”