Getty Images

CBS channels will be restored Thursday for AT&T's DirecTV, DirecTV Now and other pay-TV customers, after the two companies reached a deal and ended a nearly three-week blackout.

CBS and AT&T said Thursday that their multi-year deal will cover the CBS-owned stations of its namesake broadcast channel, the CBS Sports Network and the Smithsonian Channel across DirecTV, DirecTV Now and U-verse, as well as the upcoming TV platforms that AT&T hopes to launch. (Editors' note: CNET is owned by CBS.)

AT&T aims to launch a Netflix-like streaming service called HBO Max in spring 2020, but that isn't expected to carry live channels.

The blackout hit AT&T pay-TV customers in 17 cities -- New York, Los Angeles, Chicago, Philadelphia, Dallas, San Francisco, Boston, Atlanta, Tampa, Seattle, Detroit, Minneapolis, Miami, Denver, Sacramento, Pittsburgh and Baltimore -- as well as more than 100 CBS stations and affiliates on DirecTV Now. It stemmed from a dispute over the rates that AT&T pays CBS to carry the channels, after the companies' 2012 agreement expired last month.

In a brief joint statement, the companies didn't disclose financial terms.

"CBS and AT&T regret any inconvenience to their customers and viewers and thank them for their patience," they said.