Postmaster General Louis DeJoy may have to testify under oath about the U.S. Postal Service's apparent failure to complete a court-mandated sweep of processing centers for undelivered mail-in ballots before a Tuesday afternoon deadline. 

U.S. District Judge Emmet Sullivan in Washington said during a Wednesday hearing that he was "shocked" the Postal Service had not complied with the mandatory sweep of mail-processing facilities.

FEDERAL JUDGE ORDERS USPS TO TAKE 'EXTRAORDINARY MEASURES' TO DELIVER MAIL-IN BALLOTS ON TIME

“At some point, the postmaster is either going to have to be deposed or appear before me and testify under oath,” Sullivan said. “The court has been very clear that it expects full compliance."

The Postal Service confirmed to Fox News on Wednesday that it had completed the sweeps late Tuesday and found only 13 ballots, all in Pennsylvania.

"The Inspection Service was not able to conduct specific sweeps at specific times of the day, as this was not operationally possible to implement in the limited time available for the reasons stated above," the Postal Service said in a statement on why it did not comply with the order. "Our understanding at the hearing was that the court did not intend for the Postal Service to make operational changes on Election Day, but rather to confirm that the existing processes were functioning as anticipated."

DEPLOYED US MILITARY MEMBERS EXPRESS CONCERNS OVER MAIL-IN BALLOT COUNT

Sullivan had previously ordered the Postal Service to conduct a sweep of its facilities between 12:30 p.m. and 3 p.m. on Election Day in response to lawsuits by several voting-rights groups; the federal agency told Sullivan it was not logistically possible to meet his deadline. 

"The court has been very clear that it expects total compliance," Sullivan said Wednesday. "I was just as shocked to hear that nothing else was done after the injunction was issued."

Postal Service data showed that as of Sunday, about 300,000 ballots that were received for mail processing had not been scanned for delivery to election authorities.

With millions of Americans voting by mail as a result of the coronavirus pandemic, and growing scrutiny from President Trump and Republicans on the validity of those ballots, the importance of on-mail delivery has taken on a new urgency.

CLICK HERE TO GET THE FOX NEWS APP

Only ballots that were postmarked by Nov. 3 will be counted in the election.

The USPS said in a statement: “The assumption that there are unaccounted ballots within the Postal Service network is inaccurate. These ballots were delivered in advance of the election deadlines. We employed extraordinary measures to deliver ballots directly to local boards of elections. When this occurs, by design, these ballots bypass certain processing operations and do not receive a final scan. Instead, they are expedited directly to the boards of elections.

"We remain in close contact with state and local boards of elections and we do not currently have any open issues. Additionally, the Postal Inspection Service has physically inspected all plants that process ballots. We will continue to accept, process and deliver ballots as they are entered into the network.”

Fox News' David Spunt contributed to this report