A second federal judge Friday ordered the Internal Revenue Service to explain under oath how the agency lost two years of emails from former IRS official Lois Lerner.

At a hearing for a lawsuit brought against the IRS by the conservative group True the Vote, U.S. District Court Judge Reggie Walton told government lawyers on Friday he wants an affidavit explaining how the emails were lost.

The IRS said Lerner’s computer suffered a crash in 2011 that destroyed many email records. Subsequent attempts to recover the emails failed, according to the agency.

True the Vote brought its suit against the IRS after being subjected to what it claims was politically motivated scrutiny from the agency, as well as the FBI.

Another judge, presiding over a Freedom of Information Act lawsuit brought against the IRS by the watchdog group Judicial Watch, gave the agency on Thursday a month to explain in writing how it lost emails from Lerner.

Judicial Watch is seeking email records from the IRS, and says the agency failed to disclose that many of those records were lost, despite knowing of the crash long before it notified Congress.

"These extraordinary court rulings are key steps in unraveling the Obama IRS’s ongoing cover up of its abuses against critics of this administration," Judicial Watch president Tom Fitton said in a statement following the hearing.

Lerner was the former head of the agency’s tax-exempt division at the heart of the IRS targeting scandal. She retired amid the scandal and has invoked her Fifth Amendment rights to avoid testifying.

The IRS’ disclosure that her emails were lost has given more ammo to congressional Republicans investigating the targeting scandal.

"The IRS has stonewalled this investigation from the word go, and we will need every constitutional tool at our disposal, including the courts, to get to the truth. The court’s ruling was proper and timely," Rep. Kevin Brady (R., Texas) said in a statement.

The IRS said it went to "unprecedented efforts" to reconstruct Lerner’s emails, including searching emails of other officials, resulting in an additional 24,000 emails being provided to lawmakers.

But because of the crash, the IRS said it cannot produce emails between Lerner and the White House, Treasury Department, Justice Department, FEC, or other Democratic offices.

"The IRS has made unprecedented efforts in connection with this effort, producing more than 750,000 pages of documents to help complete the investigations," the agency said in a statement after it announced the lost emails. "In total, the IRS’s efforts to respond to Congress have involved more than 250 IRS employees working more than 120,000 hours at a direct cost of nearly $10 million."