21st Century Fox is closing in on an agreement with Sinclair Broadcast Group to buy at least six TV stations, a transaction that stems from Sinclair’s pending $3.9 billion acquisition of Tribune Media.

The deal is understood to encompass Tribune-owned Fox affiliates in five markets — Seattle, Denver, Salt Lake City, Sacramento, and Cleveland — and Tribune’s CW affiliate that serves the Miami market. The pact also ensures the Sinclair will lock in long-term Fox Broadcasting Co. affiliation deals for dozens of other stations it owns that are currently Fox affiliates.

A rep for 21st Century Fox declined to comment. A rep for Sinclair could not immediately be reached for comment. A source cautioned that the fine points of the deal are still being hammered out and that it may include a few more stations.

The sale is contingent on Sinclair closing its acquisition of Tribune Media. The regulatory review process on the Sinclair-Tribune merger is coming to a head at the FCC and Justice Department now that Sinclair has filed its plan for station divestitures. The Tribune acquisition will put Sinclair well over the limit of the FCC’s TV station ownership rules, forcing some divestitures.

Sinclair surprised the industry on Wednesday by unveiling its decision to sell Tribune’s WPIX-TV New York and WGN-TV Chicago — albeit with a caveat that Sinclair hopes will allow the company to still operate the New York and Chicago stations through a contract arrangement with the new owner. Sinclair has a buyer (or buyers) lined up for WPIX and WGN but did not disclose them in Wednesday’s FCC filing. Fox would not be able to buy those stations because it already owns two outlets in both New York and Chicago, and FCC rules bar a single entity from owning more than two top-rated stations in the same market.

Four of the six Tribune stations that Fox aims to acquire are in markets with NFL teams — a priority for Fox in its hunt for additional TV stations. Fox has doubled down on its investment in NFL programming through the megabucks five-year deal it struck late last month for rights to “Thursday Night Football” games starting next year. Those games come on top of Fox’s longstanding deal for the NFL’s NFC conference rights. Fox’s O&Os and affiliates clean up on local advertising during NFL games. Having more O&Os in NFL markets gives Fox that much more clout with national advertisers and the league.

The Tribune stations expected to be sold to Fox are: Seattle (KCPQ), Denver (KDVR), Salt Lake (KSTU), Sacramento (KTXL), Cleveland (WJW), and Miami (WSFL). The Fox Television Stations group at present stands at 28 stations serving 17 major markets. The effort to expand the station group comes as 21st Century Fox prepares to hone the focus of its operations to the Fox Broadcasting network, Fox News and Fox Sports, following its market-jolting, $52.4 billion deal reached in December to sell the 20th Century Fox studio and other entertainment assets to Disney.

For Sinclair, the long-term affiliation deal with Fox will relieve the uncertainty about Fox’s desire to recruit alternate affiliates in many Sinclair markets. The Tribune acquisition will make Sinclair the largest owner of Fox affiliates in the country, even more than 21st Century Fox itself. Fox’s concern about Sinclair’s iron grip on such a big chunk of the network’s distribution base led to speculation last year about Fox trying to orchestrate a large-scale deal with rival station owners to elbow Sinclair out of affiliation pacts in many markets.

Sinclair has identified a handful of smaller markets that will also require divestitures to comply with FCC ownership limits. The Tegna station group is said to be in talks with Sinclair about picking up some of those stations.