(Reuters) - Viacom Inc has renewed its carriage contract with AT&T Inc, avoiding a blackout of MTV, Nickelodeon and Comedy Central for users of the telecom carrier’s pay TV service DirecTV, the companies said on Monday.

Viacom needed to resolve the AT&T contract before considering any other strategic moves including a potential tie-up with CBS Corp, sources told Reuters on Friday.

Shares of Viacom rose nearly 4 percent to $26.30 before the opening bell, while those of AT&T were marginally higher.

“We are pleased to announce a renewed Viacom-AT&T contract that includes continued carriage of Viacom services across multiple AT&T platforms and products,” the companies said.

The initial deadline to reach a new contract was by midnight of March 22. The companies, however, continued to negotiate past the deadline.

Such conflicts have become increasingly common as media companies consolidate and viewers shift from traditional pay TV services to streaming services such as Netflix Inc and Amazon.com Inc’s Prime Video.

In November, AT&T-owned premium cable network HBO stopped being carried on Dish’s satellite television service after failing to reach a new deal and has not returned to the service.

Last week, Viacom accused the wireless carrier of abusing its powers after buying Time Warner Inc.

AT&T has said Viacom’s channels are no longer as popular as they once were, and accused them of being a “serial bad actor” in contract renewal negotiations.

AT&T is Viacom’s largest distributor, representing 24.5 million total video subscribers, and was responsible for about 15 percent of Viacom’s 2018 revenue.