Nexstar said it would pay $46.50 per share, representing a premium of 15.5 percent to Tribune Media's closing price on Friday. Tribune shares rose 10 percent and Nexstar shares 3 percent in midday trading.

The value of the deal was in line with what Reuters reported on Sunday, citing people familiar with the matter.

Including debt, the deal is worth $6.4 billion.

The acquisition comes just three months after Sinclair Broadcast Group Inc $3.9 billion deal to buy Tribune collapsed over regulatory hurdles.

However, since then the broadcast media sector has seen a flurry of merger talks, amid expectations that the U.S. Federal Communications Commission (FCC) could relax restrictions on how many stations broadcasters can operate.

Irving, Texas-based Nexstar said the transaction was subject to approvals by Tribune's shareholders and regulators including the FCC. The company intends to divest certain television stations necessary to comply with regulatory ownership limits.

Nexstar owns, operates and provides sales and other services to 174 television stations reaching nearly 39 percent of all U.S. television households, while Tribune Media owns or operates 42 local television stations reaching approximately 50 million households.

Nexstar outbid private equity firm Apollo Global Management LLC with an all-cash offer that values Tribune at around $46.50 per share, three sources had told Reuters.

The deal, expected to close late in the third quarter of 2019, will add about $160 million in the first year to Nexstar's earnings, the companies said.

"The transaction will result in approximately 46 percent growth in Nexstar's average annual free cash flow in the 2018-2019 cycle to approximately $900 million," Nexstar's chief executive officer Perry Sook said in a statement.

Nexstar said it had received committed financing for the transaction from BofA Merrill Lynch, Credit Suisse and Deutsche Bank.

"We think this is a great acquisition for Nexstar that would position them to be the dominant player in the space...the transaction is massively FCF accretive and the synergy numbers are likely to prove conservative," said Benchmark Co analyst Daniel Kurnos.

BofA Merrill Lynch is serving as the financial adviser and Kirkland & Ellis LLP and Wiley Rein LLP as legal counsel to Nexstar.

Moelis & Co and Guggenheim Securities are financial advisers to Tribune Media and Debevoise & Plimpton LLP and Covington & Burling LLP are its legal counsel.

(Reporting by Arjun Panchadar and Sonam Rai in Bengaluru; Editing by Saumyadeb Chakrabarty and Shailesh Kuber)

By Arjun Panchadar and Sonam Rai