Last spring, more than a dozen federal agents spent six hours searching the law firm of a prominent Maryland attorney, sweeping up thousands of emails, files and other documents in a money laundering and obstruction investigation.

A federal appeals court panel subsequently declared the government’s review of the seized material invalid in a unanimous ruling, citing long-standing protections for the sacrosanct communications between lawyers and their clients.

The Justice Department is now considering whether to ask the full court to rehear the case, concerned that the ruling will strip away what they say is a valuable tool for sifting through sensitive, privileged material in criminal investigations throughout the country.

Prosecutors asked the U.S. Court of Appeals for the 4th Circuit for more time to decide next steps because of the “potential ramifications” for what are known as filter teams used by the government nationwide, according to the request from Maryland U.S. Attorney Robert K. Hur. The teams — also called “taint teams” — are designed as firewalls aimed at limiting disclosure of attorney-client communications to front-line investigators.

The solicitor general must sign off on any petition for review before a full panel of judges and has until Wednesday to decide.

Defense attorneys counter that prosecutors should not be allowed to rummage through sensitive law firm files or conduct an in-house review of protected, privileged documents.

Attorneys representing the Baltimore law firm, which went to court to challenge the June search, noted that thousands of electronic files unrelated to the investigation were confiscated. Of the approximately 52,000 emails seized from the firm’s files, 99 percent had nothing to do with the target of the investigation, according to court filings.

“If clients and their lawyers believe that prosecutors may one day sift through their communications in searches involving unrelated matters, clients are less likely to be candid with their lawyers, and lawyers will hesitate before writing down what they need to write down,” the firm’s attorney James P. Ulwick argued in the September appeal at the Richmond-based court, which reviews cases from Maryland.

Searches of law firm offices are rare and highly sensitive, requiring higher-level approval within the Justice Department because of the importance of attorney-client privilege, which allows for candid discussions and legal advice.

All of the federal judges in Maryland, who would have been asked to sign off on the search involving two prominent lawyers active in the state’s courts, declined to participate because of potential conflicts. The search and filter team process was instead approved and affirmed by judges in Northern Virginia.

The underlying case involves a three-year investigation of a Maryland lawyer accused of assisting drug dealers with money laundering and obstruction of federal investigations. The lawyer, Kenneth Ravenell, is not named in appeals court filings, but contemporaneous statements to the press, first reported by the Baltimore Sun, match the timing of the search of his office — and the office of Ravenell’s former attorney, Joshua Treem, of the firm Brown, Goldstein & Levy.

Ravenell was indicted in September and pleaded not guilty; a trial is set for April. Treem has not been charged.

Ravenell’s attorney Lucius Outlaw said the 4th Circuit got it right by putting a stop to “this grave threat to the attorney-client privilege, which is a fundamental pillar of our legal system, and no reason exists for overturning it.”

Treem and his law firm declined to comment.

At issue is the Justice Department’s filter team process, which uses a set of lawyers, agents and assistants not connected to the investigation, but from the same law enforcement offices, to review seized documents. That team turns over to their colleagues assigned to the case all material that is relevant and not covered by attorney-client privilege. For potentially privileged material, the team consults with the target’s lawyers to try to strike an agreement. When the government and the target’s lawyers disagree, the material is submitted to a judge. Communications used to further a crime or fraud are not shielded by attorney-client privilege.

In its October ruling, the appeals court said it was particularly troubled by the huge amount of potentially privileged communications seized that was unrelated to the investigation and the “appearance of unfairness” when the lawyers and agents conducting the review are colleagues of those conducting the investigation.

The court cited the potential for “significant problems” with a system that “left the government’s fox in charge of guarding the Law Firm’s henhouse.”

“It may well be difficult for those agents to withhold from their superiors information about possible crimes potentially identified in the seized materials,” according to the 39-page ruling written by Judge Robert B. King, a nominee of President Bill Clinton.

The government’s process, King wrote, “demonstrated a lack of respect” for attorney-client privilege by allowing the filter team to directly contact the law firm’s clients to seek a waiver of that privilege, something the government said it did not do in this case.

King was joined by Chief Judge Roger L. Gregory, initially nominated by Clinton, and Judge Allison Rushing, a nominee of President Trump, most recently a lawyer in private practice in Washington.

The debate over how the government handled the seized material is perhaps not surprising, said former federal prosecutor Timothy Belevetz.

“Neither side ever trusts the other,” he said. “Ideally, you’d have a completely impartial arbiter to call balls and strikes.”

In contrast to the Maryland investigation, the court noted in its opinion that after the 2018 search of the New York office of President Trump’s former lawyer, Michael Cohen, a judge held a hearing concerning the government’s proposed use of a filter team. That hearing allowed Cohen’s lawyer to argue against the request. A retired federal judge was appointed to review the material before Cohen’s 2018 conviction for tax, bank and campaign finance crimes related to allegations he paid to silence women who claimed to have had affairs with then-candidate Trump.

In the investigation of former Baltimore mayor Catherine E. Pugh, agents did not rely on a filter team and instead retrieved records from the office of Pugh’s attorney through a “limited subpoena.” The government did not seek any attorney-client privileged communications or other firm documents, Pugh’s lawyer said at the time before the former mayor admitted to illegally hiding profits from sales of her “Healthy Holly” children’s book series.

Stuart Berman, who led the U.S. attorney’s office in Greenbelt, Md., until 2014, said the 4th Circuit’s ruling points to a broader trend in which judges are more skeptical of such in-house reviews. Courts, he said, “are not going to be nearly as willing to entertain the idea of a filter team when you’re searching a whole law firm and vast quantities of communications.”

While the court suggested alternatives such as review by a magistrate judge or an independent special master, Berman noted that the time and cost could be a barrier. In the Cohen case, for instance, the bills submitted by the special master total approximately $960,000.

Arun Rao, another former federal prosecutor, said that until the 4th Circuit decision, most federal investigators would have assumed the use of a filter team — authorized by a magistrate judge and following preapproved procedures — would survive a legal challenge.

“I suspect that this decision will burden magistrate judges,” he said, “substantially delay sensitive investigations, and significantly increase costs to the government.”