Brad Grey, the former Paramount Pictures chairman and CEO, died on Sunday night of cancer. He was 59.

In addition to running Paramount for 12 years, Grey helped transform Brillstein-Grey Entertainment into one of Hollywood’s most successful management and production companies, playing a key role in the development of “The Sopranos” and “The Larry Sanders Show.” He also co-founded Plan B Entertainment with Brad Pitt and Jennifer Aniston, through which he produced the Oscar-winning “The Departed.”

Grey was forced out at Paramount in February in the wake of several film flops and some $450 million in annual losses at the studio.

Grey, a shrewd operator who alternately stroked and clashed with Hollywood’s key power brokers, had a tumultuous tenure at Paramount. He was credited with maintaining strong relationships with Pitt and Martin Scorsese, as well as overseeing the successful “Transformers” and “Mission: Impossible” series. However, he was faulted for failing to turn Paramount into a destination for top talent and for being unable to replenish its lineup of film franchises. As Grey and his team struggled to keep reinvigorate their lineup, Paramount’s market share plummeted, and the company finished behind all of the five other major Hollywood studios in each of the last five calendar years.

His time at the top coincided with a bruising power struggle at its corporate parent Viacom that pitted former chairman Philippe Dauman, a key ally of Grey’s, against Shari Redstone, whose family holds a controlling stake in the media conglomerate. The fight was triggered, in large part, by the failing health of Sumner Redstone, the 93-year old Viacom founder whose personal issues caused a leadership crisis. Shari Redstone prevailed against Dauman. Grey was able to keep his job for nearly seven more months, but was ultimately unable to convince the studio that he had the right vision to move Paramount forward. Viacom tapped Jim Gianopulos, the former head of Fox’s film business, to take over from Grey.

The Bronx-born Grey first broke into the entertainment business while a student at the University at Buffalo, where he became connected with Miramax founder Harvey Weinstein. He helped Weinstein with his concert promotion business. From there, Grey moved into the world of stand-up comedy, helping discover Bob Saget and forming a partnership with Bernie Brillstein, whose Bernie Brillstein Company would eventually become Brillstein-Grey Entertainment.

Of all the professional associations, none would be more important to Grey than the one he forged with Garry Shandling. Grey produced Shandling’s Showtime hit “It’s Garry Shandling’s Show” and HBO’s beloved “The Larry Sanders Show,” helping to elevate the comic’s profile. But the two had an epic falling out in the late 1990s, with Shandling suing Grey for $100 million for breach of duties. He claimed that Grey had inappropriately enriched himself by taking fees on “The Larry Sanders Show” from Shandling and from HBO. Grey counter-sued for breach of contract. Their feud split the entertainment industry into factions, with the likes of Warren Beatty and former agent Sue Mengers trying to broker a peace. Both suits were eventually settled. Shandling died of from pulmonary thrombosis in 2016 at the age of 66.

In public, Grey could come across as retiring, almost shy, but that masked a keen survival instinct and a willingness to go to the mat. During his time at Paramount, Grey also clashed with Steven Spielberg, David Geffen, and Jeffrey Katzenberg. After helping orchestrate a 2005 deal that saw Paramount buy DreamWorks for $1.6 billion in cash and debt, only to see the alliance collapse under the strain of competing ambitions and egos. DreamWorks ended up striking out on its own in 2008.

For seven years, Paramount distributed films from DreamWorks Animation, the spinoff then overseen by Katzenberg. The companies scored with the first two “Kung Fu Panda” movies and “How to Train Your Dragon,” but Paramount was unable to keep the deal, which went to Fox in 2012. Paramount started an animation division in 2011 to help fill the void.

Grey became entangled in a controversy that threatened to torpedo his time at Paramount shortly after he took the reins at the studio. He was named twice in lawsuits by screenwriter Bo Zenga over a claimed agreement to produce 2000’s “Scary Movie,” with Zenga charging that Grey used celebrity detective Anthony Pellicano wiretap Zenga during the negotiations. Grey had denied knowledge of wiretapping and both suits were dismissed, due to statute of limitations issues.

Grey is survived by his wife Cassandra Grey, their son Jules, his three grown children Sam, Max and Emily from his marriage to Jill (nee Gutterson) Grey, his mother Barbara Schumsky, his brother Michael Grey and his sister Robin Grey.

Grey’s family said there will be a small private funeral service later this week. A memorial service will be scheduled in the coming weeks. In lieu of flowers, the family asks that donations be made to the Lawrence J. Ellison Institute for Transformative Medicine of USC.

Correction: An earlier version of this article misstated the reason that the Zenga suits were dismissed.