Dec. 5 (UPI) -- Netflix agreed to buy Warner Bros. Discovery in a deal valued at $82.7 billion after securing financing from a group of banks.

Netflix said the purchase would offer users more choices and allow it to "optimize its plans," expand studio operations and create better value for shareholders. The deal includes Warner Bros. film studios, HBO and HBO Max.

The deal has a total enterprise value of about $82.7 billion and an equity value of $72 billion and will close in the next 12 to 18 months. The purchase comes after a bidding war against Paramount Skydance and Comcast. It has a breakup fee of $5.8 billion, which means that if the purchase doesn't go through, Netflix has to pay that fee to WBD.

Specifics are still unclear, but Netflix said it will maintain the current operations of WBD, "including theatrical releases for films."

Netflix said it will keep HBO and HBO Max as separate entities, but it will add some HBO content to Netflix.