After a $3.9 billion deal to sell Tribune Media to Sinclair Broadcast Group cratered, the Chicago-based media company has found a new buyer willing to pay a higher price. Nexstar Media Group has reached an agreement to acquire Tribune for about $4.1 billion in a deal that would make it the largest U.S. TV station operator. Nexstar is valuing the deal at $6.4 billion, including assumption of Tribune’s debt.

Under the deal Nexstar will pay $46.50 per share, marking a 15.5% premium for Tribune shareholders based on its Nov. 30 closing price and a 45% premium over the closing price on July 16, the day FCC chair Ajit Pai sent Sinclair’s proposed purchase to a Hearing Designation Order, effectively killing the deal. Tribune shareholders will get another 30 cents per share if the deal hasn’t closed by Aug. 31, 2019.

The boards of both companies have greenlighted the merger, which is expected to close late in third quarter 2019. BofA Merrill Lynch, Credit Suisse and Deutsche BanK are providing financing to Nexstar.

Nexstar says it expects to wring $160 million in operating synergies in the first year after the deal closes and after making required divestitures to secure regulatory approvals. The combination will boost Nexstar's reach by 50% with local TV stations in 18 of the top 25 markets and 37 of the top 50.

After spin-offs, the merged entity will reach about 39% of U.S. television households, reflecting the FCC’s UHF discount that allows a broadcaster to count only half a station’s coverage area when calculating its ownership cap for stations above channel 14. In addition to 42 TV stations, Tribune’s Chicago-based media empire owns WGN Radio (720) Chicago. Nexstar owns, operates or services 174 stations. Before spin-offs, the merged entity will own 216 TV stations in 118 markets with annual revenue of $4.6 billion and adjusted EBITDA of roughly $1.7 billion.

Nexstar, which has been eyeing Tribune for some time in the rapidly consolidating TV business, reportedly outbid private equity firm Apollo Global Management, Blackstone Group, and Hicks Equity Partners in a partnership with Cerberus Capital.

“We have thoughtfully structured the transaction in a manner that positions the combined entity to better compete in today’s rapidly transforming industry landscape and better serve the local communities, consumers and businesses where we operate,” Perry Sook, chairman, president and CEO of Nexstar said in a news release. “As with our past transactions, we have developed a comprehensive regulatory compliance plan and believe we have a clear path to closing.”

Sinclair announced on May 8, 2017, that it planned to buy Tribune’s 42 television stations and cable network WGN America. But On Aug. 10, Chicago-based Tribune pulled out of the hotly contested merger and filed a $1 billion suit against its would-be buyer. Tribune’s breach of contract complaint alleged Sinclair violated the merger agreement by not making adequate efforts to secure regulatory approval for the $3.9 deal. Sinclair responded with a counterclaim against the company.

“We are delighted to have reached this agreement with Nexstar as it provides Tribune shareholders with substantial value and a well-defined path to closing,” Tribune CEO Peter Kern said. “Together with Nexstar we can better compete by delivering a nationally integrated, comprehensive and competitive offering across all our markets.”