21st Century Fox has cut a deal with Sinclair Broadcast Group and Tribune Media to buy seven major-market Fox affiliate stations for $910 million.

The deal had been expected. Sinclair needs to divest a number of stations as part of its $3.9 billion pending acquisition of Tribune. Fox had long eyed the stations, most of which are in lucrative NFL markets. Local TV will be even more crucial to the financial performance of Fox once it completes the $52.4 billion sale of its studio and key cable assets to Disney. The deal gives Fox O&Os in 19 of the nation’s top 20 TV markets.

The Tribune-owned stations changing hands are: Seattle (KCPQ-TV), Miami (WSFL), Denver (KDVR), Cleveland (WJW), San Diego (KSWB), Sacramento (KTXL), and Salt Lake City (KSTU).

As part of the transaction, Fox has granted Sinclair affiliation renewals for the more than two dozen Fox affiliate stations owned by the Maryland-based station behemoth. Fox and Sinclair have tussled in the past as Sinclair controls a good chunk of the network’s distribution in heartland markets.

Fox was nervous that Sinclair’s hold would only grow tighter with the Tribune acquisition bringing 14 medium-sized markets into the fold. Sinclair’s need to divest a significant number of stations to comply with FCC ownership limits and Fox’s desire to expand its O&O footprint made for a natural deal, even among rivals.

“This transaction illustrates Fox’s commitment to local broadcasting and we are pleased to add these stations to our existing portfolio,” said Jack Abernethy, CEO of Fox Television Stations. “With this acquisition, we will now compete in 19 of the top 20 markets and have a significantly larger presence in the west, which will enhance our already strong platform. This expansion will further enrich our valuable alignments with the NFL, including our new Thursday Night Football rights, MLB and college sports assets. We are also happy to add many talented Tribune employees to our group, some of whom we know well.”

Fox has also granted Sinclair an option to acquire two of its stations, Chicago CW affiliate WPWR and Austin, Texas’ Fox affiliate KTBC, for pre-set prices of $15 million and $160 million, respectively.

The announcement of the Fox station sale is an indicator that Sinclair expects to complete the Tribune takeover soon. The sides first inked the buyout agreement in May 2017. The company has said it expects to wrap up the transaction by the end of this quarter, after several rounds of negotiations on divestitures and conditions with the Justice Department and FCC.