The AT&T-Time Warner deal has been two years in the making. But for the top five Time Warner executives the wait has been worth it.

Together they'll walk away with combined exit packages worth as much as $180 million.

CEO Jeffrey Bewkes will collect a little more than half of that money -- about $97.7 million based on Tuesday's closing price. Most of that will come from two sources -- $33.2 million in severance, and the retention bonus he received in stock in February 2017. The shares he'll get as part of that bonus are worth about $28 million, based on Tuesday's closing price.

Related: Judge approves $85 billion AT&T-Time Warner deal

Bewkes and the other top executives were each granted retention bonuses soon after the agreement to have AT&T (T) buy Time Warner (TWX) was announced in October of 2016. Those bonuses were put in place to ensure that they would stay through the arduous process of winning regulatory approval of the deal. The deal was approved Tuesday after a federal judge rejected Justice Department arguments that the combination violated antitrust laws.

Bewkes and his colleagues could also collect lucrative severance packages, and benefit from the fact that some of their shares will vest immediately when the deal closes, or upon being terminated.

Retention bonuses and severance packages are common for top executives of companies which are going through mergers said Courtney Yu, director of research at Equilar, a consultant that tracks executive compensation data. Shareholders need executives to focus on negotiating and completing mergers on the best possible terms, rather than worrying about what might be best for their own personal future.

Related: AT&T wins big. Next up: Comcast and Fox

The other top executives will also do very well. Chief Financial Officer Howard Averill has an exit package worth about $32.3 million, while Paul Cappuccio, the company's general counsel will get $26.7 million. Gary Ginsberg, its executive vice president of marketing and communications, is due $12.2 million, while Carol Melton, its executive vice president of global public policy, will get an estimated $11 million.

None of these figures include the value of shares the executives already own, or the net value of the options they hold once the exercise price is taken into account.

For Bewkes, the total net value of those shares and options is $342.1 million. According to filings, the chief executive owns more than 1.3 million shares of stock outright, and has options for 3.9 million more.

None of these figures are precise, since these executive payouts will also be tied to the company's performance and based on when they leave the company. And of course they won't get any severance if they end up staying with the merged company.