New York CNN Business  — 

CBS and AT&T have reached a new carriage deal to end a nearly three-week blackout that affected millions of viewers.

The two companies announced Thursday they have signed a new multi-year agreement effective immediately.

“CBS and AT&T regret any inconvenience to their customers and viewers and thank them for their patience,” they said in joint a statement.

Local CBS stations in several major cities, including New York, Chicago and Los Angeles and several cable networks were dropped by AT&T-owned DirecTV, streaming service DirecTV Now and U-Verse on July 20 after a previous agreement expired. The services reached 6.6 million people combined.

At the heart of the dispute was the renewal rate that AT&T was willing to pay to carry CBS’ programming. AT&T accused CBS of charging too much, while CBS said it was “simply looking to receive fair value for its popular programming.” For several weeks, viewers on DirecTV and U-Verse were deprived of popular shows like “The Late Show with Stephen Colbert” and “Big Brother.”

The agreement’s financial terms were not disclosed. AT&T (T) owns CNN’s parent company WarnerMedia.

The new CBS (CBS) contract comes at a time when it’s reportedly close to publicly announcing a merger with Viacom (VIA). The latter didn’t mention a potential deal in its earnings Thursday.