WASHINGTON — CBS Corp. and TV provider Dish Network Corp. have reached an agreement that ends a contract dispute that led to a short programming blackout in local markets around the country, the companies announced Saturday.

CBS had blocked Dish from carrying the local channels of CBS-owned TV stations for about 12 hours starting around 7 p.m. Eastern time Friday. The 18 markets affected included New York, Chicago, Los Angeles, Dallas, Boston and Miami.

In a joint statement Saturday, the companies said they had reached a multiyear deal that will allow Dish to carry CBS-owned TV stations nationwide as well as various cable channels, including the CBS Sports Network, the Smithsonian Channel and Showtime. Dish has about 14 million subscribers.

The brief blackout was the latest skirmish between television companies that are seeking higher payments for their programming and the cable and satellite companies that distribute the programming and say the higher programming costs will lead to higher bills for their customers.

Under the agreement, Dish will get the rights to deliver Showtime programming on mobile devices. The companies said the agreement will result in the dismissal of pending litigation between them, including disputes over such services as PrimeTime Anytime and AutoHop, a Dish service that allows viewers to skip commercials. Under the agreement, viewers will not be able to skip commercials for the first seven days after a program is broadcast on a CBS-owned station.

Financial terms of the deal were not disclosed, but executives from both companies expressed satisfaction with the deal.

"We are pleased to continue delivering CBS programming to our customers while expanding their digital access to Showtime content through Showtime Anytime," Warren Schlichting, a Dish senior vice president, said in the statement.

Ray Hopkins, president of television networks distribution for CBS, said the deal met the company's economic and strategic objectives.

"We look forward to having Dish as a valued partner for many years to come," he said.

The programming returned ahead of a weekend of football games televised by CBS including the Southeastern Conference championship game Saturday between Alabama and Missouri.