UPDATED with additional details: The war between Viacom CEO Philippe Dauman and the company’s dominant shareholder Sumner Redstone is over.

Viacom’s board just approved an arrangement with Dauman giving up his role as CEO but remaining as non-Executive Chairman until September 13, when he will leave with a $72 million payout, according to sources familiar with the situation.

Tom Dooley moved from COO to interim CEO until September 30, the end of the company’s fiscal year, and could be named to the job without the “interim” modifier. That decision will be up to Viacom’s board, which will expand to 16 with the addition of five candidates Redstone has proposed. His National Amusements owns 80% of Viacom’s voting shares.

When Dauman leaves, he will not be replaced on the board, bringing the number down to 15. Three other directors will depart at the company’s next annual meeting, expected around January or February.

Dauman and Sumner’s daughter Shari Redstone were said to have been cordial and complementary of each other in the board’s phone meeting this evening. Sumner, who has difficulty speaking, was on the call but did not say much, if anything.

Dauman had accused her of manipulating her 93-year-old father in an effort to seize power, a charge that she vigorously denied.

Dauman has been authorized to present the board with a proposal to sell a 49% stake in Paramount. But it would only be approved if directors are unanimous in support. Up to now Redstone has opposed a deal.

The CEO told analysts early this month that he was talking to “a handful of prospects.” But he acknowledged that the process “has slowed down in recent weeks,” though he remained hopeful he could still move forward with “a highly beneficial transaction to present to our board.”

The agreement with Redstone ends court battles in the Massachusetts Probate and Family Court and Delaware’s Chancery Court. In the first, Dauman and director George Abrams wanted to overturn Redstone’s move to oust them from his family’s trust and the National Amusements board. In the second, Viacom wanted to block National Amusements’ effort to replace five directors — including Dauman.

The agreement does not affect a Massachusetts suit by Redstone’s granddaughter, Keryn, who opposed the changes at the family trust and National Amusements.

Her lawyer, Pierce O’Donnell, says that she will “carefully review any settlement … to assure that it is in the best interests of her fellow trust beneficiaries and herself.” The trial is scheduled to begin on September 19.

Dauman and Viacom charged that Redstone is no longer competent to manage his affairs — and was being manipulated by Shari, who’s Viacom’s Vice Chair. They wanted an independent doctor to examine him.

The Redstones rejected the allegations, saying that Sumner is still calling the shots at his media empire, which includes CBS.

The Massachusetts and Delaware judges had left open the possibility that they would approve an exam.

Viacomlogoblackandwhite

Investors have grown weary of the fight, which has effectively frozen Viacom at a time when its cable networks and Paramount are struggling. The stock has lost nearly half of its value over the past two years and has lagged the overall market over the past 12 months. Domestic ad sales at the company’s cable networks declined 4% in the June quarter, making it the eighth consecutive quarter that the number has dropped. Ratings drops have been especially notable at Comedy Central and MTV.

Meanwhile, Dauman acknowledged that Paramount has “had a rough go at the box office recently,” including with disappointing sales for a film he had long touted: Teenage Mutant Ninja Turtles: Out of the Shadows.

“Fundamentally for Viacom, if it could have gone wrong in [the current fiscal year], it did,” MoffettNathanson Research’s Michael Nathanson said early this month. “Almost every driver” of earnings growth “declined massively worse than expected. The question is after slashing estimates again, what can get worse from here?”