Google committed “clear abuse of privilege” by implementing a policy that automatically deleted employee chat records, according to the judge overseeing a major Justice Department antitrust trial targeting its alleged digital advertising monopoly.

US District Judge Leonie Brinkema shredded Google during a hearing to consider the DOJ’s motion for an “adverse inference” finding against the company for deleting records it was ordered to preserve. If granted, it would allow the court to assume that Google intentionally acted to destroy evidence relevant to the case.

The motion centered on a policy outlined in a 2008 memo from Google’s chief legal officer Kent Walker, who advised employees to turn off their chat history by default — a practice referred to internally as “Vegas mode.”

Judge Leonie Brinkema ripped Google during a hearing this week. Goldfarb Center for Public Affairs

As a result, employee messages were automatically deleted after 24 hours.

“I certainly do not mind saying [this] is not the way in which a responsible corporate entity should function,” Brinkema said Tuesday, according to a transcript obtained by AdWeek. “A clear abuse of privilege.”

The judge’s remarks represent a major setback for Google, which faces the potential breakup of the digital advertising technology empire that yielded more than $300 billion in revenue last year alone.

The non-jury adtech case kicks off Sept. 9 — just weeks after US District Judge Amit Mehta ruled that Google broke antitrust laws in a separate DOJ lawsuit aimed at its online search business.

Brinkema, who will ultimately decide Google’s fate in the trial, said the Walker memo contained “incredible smoking guns.”

While she did not issue a formal ruling, the judge noted that she would draw “inferences” as both sides call witnesses to testify.

“An awful lot of evidence has likely been destroyed,” Brinkema added.

A Google spokesperson declined to comment. In the past, the company has denied wrongdoing while asserting it has provided millions of records in response to discovery requests.

Google has repeatedly faced sharp criticism in court over its failure to preserve employee chat records relevant to the various antitrust investigations into its business. Experts have long pointed to the issue as a critical weak point in its defense strategy, as The Post has reported.

Google faces several antitrust lawsuits targeting its empire. AP

While Mehta declined to sanction Google for misconduct related to the destroyed records during the online search trial, he referred to the company’s handling of evidence as “negligent.”’

“The court’s decision not to sanction Google should not be understood as condoning Google’s failure to preserve chat evidence,” Mehta said. “Any company that puts the onus on its employees to identify and preserve relevant evidence does so at its own peril.”

During the trial, Google CEO Sundar Pichai said he has since taken action to end the auto-erase policy.

Elsewhere, US District Judge James Donato was similarly critical while overseeing “Fortnite” maker Epic Games’ antitrust case targeting the Google Play app store last December. Google ultimately lost the case in another landmark ruling.

During a hearing last Dec. 1, Donato said he had “never seen anything so egregious” after viewing “disturbing evidence” that Google’s auto-erase feature had deleted reams of key employee chat logs.

“This conduct is a frontal assault on the fair administration of justice. It undercuts due process. It calls into question just resolution of legal disputes. It is antithetical to our system,” Donato said at the time.