Viacom Chief Executive Philippe Dauman will collect a $46 million check next month as part of a severance package worth $72 million.

He will also be eligible for a 2016 bonus of up to $20 million under the details of the settlement disclosed Tuesday morning in a regulatory filing.

The deal calls for Dauman to get a severance payment of $58 million, including $46 million to be paid upon his exit. The rest will be paid out over the next 29 months.

Among other perks, the company will provide him with offices and pay for his “personal secretary” for three more years, as well as foot the bill for a $5 million life insurance policy. He will also get accelerated vesting of 300,000 shares valued at nearly $13 million.

The settlement put a stop to a boardroom battle that pitted Dauman against Viacom’s controlling shareholders, Sumner Redstone and his daughter, Shari.

The deal covers all of Dauman’s legal expenses during the three-month battle over who would eventually steer Redstone’s $40 billion empire, which also includes CBS. Shari prevailed after orchestrating a coup through Redstone’s holding company, National Amusements Inc.

The CEO role will be filled by Dauman’s longtime lieutenant, Chief Operating Officer Thomas Dooley, through at least Sept. 30. He could stay on longer, but that depends on the board.

Dauman will also be allowed to pitch Viacom’s board, which added five new members as part of the settlement, on his plan to sell a minority interest in Viacom’s Paramount film studio.

The filing also makes it clear that Paramount, led by Chairman Brad Grey, will be on a tighter leash going forward. The board wants a comprehensive review of the studio’s performance and 2017 budget, and is reserving the right to weigh in on more routine business transactions, according to the filing.

The studio’s latest film, a widely panned remake of “Ben-Hur,” flopped at the box office over the weekend.