Google’s top lawyer routinely ignored company rules regarding dalliances with underlings — and pointed to the lecherous ways of top Googler Eric Schmidt to justify his philandering, an explosive new blog post alleges.

David Drummond, chief legal officer of Google’s parent company Alphabet, dabbled in numerous office romances, according to a former underling, who dished on her own extramarital affair with the top Silicon Valley lawyer in a blog post Thursday.

Jennifer Blakely, who wrote about the affair with her married boss on blogging web Medium, painted a picture of Drummond as a serial womanizer who openly flouted the company’s rules against dating subordinates.

“David was well aware that our relationship was in violation of Google’s new policy which went from ‘discouraging’ direct-reporting-line relationships to outright banning them,” she wrote.

Drummond didn’t tell his superiors about the fling even while she was pregnant with his child — and then he left her for a co-worker, she claimed.

Drummond didn’t return a request for comment, but Google directed The Post to a personal statement where he denied having “started a relationship with anyone else who was working at Google or Alphabet.” He said he takes “a very different view about what happened,” and that he revealed the Blakely affair to “our employer at the time.”

“It’s not a secret that Jennifer and I had a difficult break-up 10 years ago,” he said on the statement posted on Twitter by Buzzfeed. “I am far from perfect and I regret my part in that.”

Google recently made headlines for eye-popping severance packages it has given to executives accused of sexual misconduct — including a $90 million golden parachute for Android creator Andy Rubin. The issue came to a head last November, when more than 20,000 Google employees around the world staged a walkout in protest of the company’s policy.

Google co-founder Sergey Brin also made waves when he got romantically involved with the marketing manager for Google Glass — a pet project of his.

Meanwhile, Schmidt — who stepped down from his role as executive chairman of Alphabet in June — is a notorious philanderer, despite being married for over 30 years to Wendy Schmidt. In 2013, Page Six reported that Schmidt spent $15 million on a private, no-doorman Manhattan penthouse said to be a love nest to accommodate his multiple affairs.

Blakely said she joined Google’s legal department in 2001 and worked directly for Drummond, who at the time was the company’s general counsel. Drummond told her he was estranged from his wife at a party in 2004, and the pair soon began their affair.

After their child was born in 2007, the company told Blakley that one of them had to leave, she said. Blakely was moved to sales but eventually left Google altogether with assurances from Drummond, whom she lived with at the time, that he would help her and the baby out financially, she claimed.

In 2008, another Googler told Blakely that Drummond had left a party with two female subordinates from the legal department — and was taking them to San Francisco.

“Don’t expect me back. I’m never coming back,” Drummond allegedly texted her when she asked where he was.

Drummond, who only began divorce proceedings in 2017, then had an affair with his “personal assistant,” as well as one of them women he left the party with in 2008, Blakely said.

From then on, Drummond only saw Blakely and their child sporadically, and only on his terms. When Blakely objected to his long disappearances, Drummond reportedly responded by showing her a Daily Mail story about then-Google chairman Schmidt.

“David explained to me how Eric’s ‘personal life’ was, in essence, his privilege,” Blakely wrote. “Since I was no longer ‘personal life’ it was time for me to shut up, fall in line and stop bothering him with the nuisances or demands of raising a child.”

Google declined to comment.