CBS and AT&T signed a new multi-year content carriage agreement, ending a 20-day blackout that began when the previous, seven-year deal expired last month.

As a result of the contract dispute and after months of negotiations over retransmission fees, CBS stations went dark for more than 6.5 million DirecTV, DirecTV Now and AT&T U-verse customers in at least 14 US cities, including New York, Los Angeles and Chicago, beginning July 19.

The agreement includes retransmission consent for all 26 CBS-owned stations in 17 markets including New York, Los Angeles, Chicago and San Francisco, the companies said.

The companies did not disclose the terms of the agreement.

The two sides negotiated over pricing, as well as whether AT&T could sell CBS’ All-Access streaming service as a separate option and whether CBS would be required to produce programming such as the Grammy Awards in a higher-than-typical 4K resolution, according to sources familiar with the negotiations.

They also negotiated on whether CBS would provide AT&T with past episodes and entire seasons of shows, and whether CBS content would be available to all DirecTV consumers, according to the sources.

CBS is one of several networks — including sibling company Viacom, A&E Networks (owned jointly by Hearst Networks and the Walt Disney Co.) and Nexstar — to publicly feud with AT&T over contract negotiations this year.

The contract dispute comes at a time of uncertainty for CBS and transition for AT&T. CBS is considering a merger with Viacom. AT&T bought Time Warner — which it renamed WarnerMedia — for $85 billion last year, and is preparing to launch its HBO Max streaming service in spring 2020.