In a rare public rebuke, the chief judge of the Foreign Intelligence Surveillance Court slammed the FBI Tuesday for misleading it in applications to wiretap a former Trump campaign aide, giving the bureau until Jan. 10 to come up with solutions.

The order came in the wake of findings from Justice Department Inspector General Michael E. Horowitz, who uncovered multiple instances of abuse in his review of the feds’ use of FISA warrants to surveil Carter Page, a one-time foreign policy adviser to the Trump campaign.

The court ripped the FBI for mistakes it made in the Page case, and ordered the agency to explain how it will improve its warrant submissions in light of the litany of errors Horowitz uncovered.

“The FBI’s handling of the Carter Page applications, as portrayed in the OIG report, was antithetical to the heightened duty of candor described above,” FISA court presiding Judge Rosemary Collier wrote in an opinion for the court published Tuesday.

“The frequency with which representations made by FBI personnel turned out to be unsupported or contradicted by information in their possession, and with which they withheld information detrimental to their case, calls into question whether information contained in other FBI applications is reliable.”