A judge on Thursday gave the Internal Revenue Service until Aug. 10 to explain under oath how it lost emails that Republicans are seeking as part of their investigation into accusations that the agency targeted conservative groups.

The emails belonged to Lois Lerner, a former I.R.S. official at the center of the investigation, and the judge, Emmet G. Sullivan of the Federal District Court for the District of Columbia, assigned a federal magistrate to assist in finding the missing records.

The ruling came in a lawsuit filed by Judicial Watch, a conservative advocacy group.