Viacom’s lead lawyer, who spearheaded the media giant’s many boardroom legal battles over the past two years, is exiting the company, The Post has learned.

General Counsel Mike Fricklas, a 24-year veteran of the New York company, is one of a handful of top executives to leave the company in recent months.

As Viacom’s top legal eagle, the 56-year old lawyer seemed to spend more time in a courtroom than at headquarters in recent times as waged battle for then-Chief Executive Philippe Dauman against controlling shareholder Sumner Redstone and his daughter, Shari Redstone.

Both Redstone battled long and hard to oust Dauman — who stepped down last summer.

Viacom has been a huge source of work for law firms in recent months. First it hired Paul, Weiss to help defend management actions and then Debevoise & Plimpton to explore a merger with CBS.

The merger attempt was recently stopped.

No replacement for Fricklas has been named although, sources said, Viacom is conducting an internal and external search.

Viacom CEO Bob Bakish is expected to alert staffers on Friday afternoon about Fricklas’ exit.

“I want to let you know that Mike Fricklas, EVP, General Counsel and Secretary for Viacom has decided to step down from his role,” a draft of the memo, obtained by The Post, read.

“Mike joined Viacom in 1993, and since 1998 has led Viacom’s best-in-class legal team, which plays a critical role in making sure our incredible content can be shared with viewers across platforms and all over the world.

“Mike has earned a reputation as one of the leading attorneys in the entertainment industry. He has deep roots in technology, policy and business, and an impressive track record of advocating on our behalf in the face of entertainment’s most pressing issues.

“Most importantly, Mike has been a trusted colleague and friend to many of us. Not every company is lucky enough to have someone as committed as Mike working for them, and we are fortunate to have enjoyed his service, counsel and loyalty for so many years. His leadership and dedication will be missed.

“We’re grateful that he leaves us with such a deep and talented team, and that he’ll be staying on through the transition as we work to identify his successor. We’ve already started the search, which we hope to be back to you shortly with news on.

“Please join me in thanking Mike for all the support he has given Viacom over the course of his remarkable 24-year career here, and wish him well in his next adventure.”

The memo was signed — “Best, Bob”

Our editors found this article on this site using Google and regenerated it for our readers.