(Reuters) - Sinclair Broadcast Group Inc SBGI.O said on Monday it would buy Tribune Media Co TRCO.N, one of the largest U.S. television station operators, for about $3.9 billion, giving Sinclair a greater foothold in big broadcast markets like New York and Chicago.

The Tribune Tower in Chicago, April 2, 2007. REUTERS/John Gress

Shares of Tribune, which operates 42 U.S. television stations, rose 5.2 percent to $42.42. Sinclair shares fell about 3 percent to $35.90.

A recent U.S. Federal Communications Commission vote to reverse a 2016 decision limiting the number of television stations some broadcasters can buy helped pave the way for the deal.

Sinclair may still have to sell certain stations such as St. Louis and Salt Lake City in order to comply with FCC regulations, Chief Executive Chris Ripley said on a conference call.

The sale will mark the end of a long road for Tribune, whose name was long intertwined with the city of Chicago, where the Chicago Tribune newspaper was founded more than 150 years ago. The company once owned the Chicago Cubs baseball team.

The sale comes after a decade of turmoil for the company, which was acquired by real estate mogul Sam Zell and then by private equity firms. It emerged from bankruptcy in late 2012 and completed a spinoff of its newspaper assets in 2014 into a company now known as Tronc Inc TRNC.O.

Wells Fargo analyst Marci Ryvicker said the deal’s biggest cost savings will come from retransmission fees, which are the payments station groups like Sinclair make to broadcasters such as Fox, CBS and NBC to carry their programming.

Tribune’s portfolio would help expand Sinclair’s already vast network of 173 stations in 81 U.S. markets and marks the largest acquisition for the Baltimore-based company.

Sinclair also gets cable network WGN America and a stake in the Food Network, a joint venture between Tribune and Scripps Network Interactive Inc SNI.O.

In addition to Sinclair, Twenty-First Century Fox Inc FOXA.O and Nexstar Media Group Inc NXST.O had considered an acquisition of Tribune, Reuters has reported.

The combined company could have more leverage in negotiations with Fox since it will own a large chunk of Fox broadcast affiliates around the country.

The $43.50 per share offer represents a 26 percent premium over Tribune’s closing price on Feb. 28, a day before Reuters broke the news that Sinclair had approached Tribune about an acquisition.

Tribune stockholders will receive $35 in cash and 0.23 share of Sinclair stock for each Tribune share. Sinclair will assume about $2.7 billion in debt in the deal, which is expected to close in the fourth quarter.

J.P. Morgan JPM.N advised Sinclair while Moelis & Co MC.N and Guggenheim Securities advised Tribune.