Eldorado Resorts has agreed to buy Caesars Entertainment for about $8.5 billion in cash and stock, as it looks to build scale to take on competition from larger companies such as Las Vegas Sands and Wynn Resorts.

The deal comes more than three months after Caesars agreed to give billionaire investor Carl Icahn three board seats to his representatives and a say on the selection of its next chief executive officer.

Icahn, who has been pressing for a sale of Caesars, held a 14.75% stake in the company as of March 31, according to data from Refinitiv Eikon.

Reuters, citing people familiar with the matter, reported on Sunday that Eldorado had clinched a deal with Caesars.

Eldorado's offer of $13.01 per share represents a premium of about 30% to Caesar's closing price on Friday.

Shares of Caesars were up about 15% before the opening bell, while Eldorado was down about 5%.

Caesars, which emerged from bankruptcy in 2017, operates casinos with the Harrah's and Horseshoe brands.

The company owns and operates 34 properties in 9 U.S. states and three continents, and its long-term debt stood at $8.79 billion as of March 31.

Eldorado has a market value of about $4 billion. It had long-term debt of about $3.06 billion at the end of March. The company owns and operates 26 properties in 12 U.S. states.

Eldorado and Caesars shareholders will hold about 51% and 49% of the combined company's outstanding shares following the close of the deal in the first half of 2020.

The combined company will retain Caesars' name and own, operate and manage 60 casino resorts across 16 states. The company's board of directors will consist of 11 members, six of whom will come from Eldorado and five from Caesars.

Icahn said he was "pleased" by the deal announcement.

"It is rare that you see a merger where because of the great synergies 'one plus one equals five.' I look forward to seeing our investment prosper," he said in a statement. "While I criticized the Caesars board when I took a major position several months ago, I would now like to do something that I rarely do, which is to praise a board of directors for acting responsibly and decisively in negotiating and approving this transformational transaction."

The deal price represents a premium of 51% over Caesar's trading price on the day before Icahn's representatives joined the Caesars board on March 1.

In a parallel deal, the combined company will sell some of its real estate to VICI Properties, while generating $3.2 billion of proceeds to help pay down debt.

J.P. Morgan, Credit Suisse, and Macquarie Capital served as financial advisers to Eldorado, while Milbank and Latham & Watkins acted as its legal counsel.

PJT Partners advised Caesars on the deal, while Skadden, Arps, Slate, Meagher & Flom served as its legal counsel.