Comcast and Starz have struck a deal that will keep the premium channel in TV packages for a few more months before making the content available only as a direct subscription.

The agreement, announced Monday, averts a blackout of Starz on Dec. 31, when their current contract would expire, while transitioning Starz content out of Comcast’s Xfinity TV packages and into an a la carte offering. The deal also lets NBCUniversal carry movies and shows from Lionsgate — Starz’s parent company — on its forthcoming streaming service, called Peacock. NBCUniversal will also license content to Starz for domestic use and on its international streaming service.

Under the agreement, the flagship Starz channel, on-demand content, as well as Encore, Encore Westerns, Encore Black, and Encore Action channels will be available for Xfinity TV customers and on Flex, Comcast’s Roku-like streaming aggregation device.

The companies did not disclose financial terms of the agreement. They also did not say when Starz would be removed from packages or how much Comcast would charge customers to subscribe directly to Starz, which carries popular shows such as Outlander and Power.

The agreement ends a contentious contract dispute that drew the attention of lawmakers, including a U.S. senator who asked the U.S. Department of Justice to ensure fair competition in the marketplace, and sparked small protests outside Comcast’s headquarters. Starz had launched an advertising campaign urging customers to call Comcast and complain. Curtis “50 Cent” Jackson, an executive producer of Power, lobbied lawmakers on Capitol Hill and attacked Comcast CEO Brian Roberts on social media.

For customers who currently pay for premium packages, the agreement means they will eventually have to pay more to keep watching Starz.

In October, Comcast said it would charge customers $12 a month to subscribe directly to Starz. A November notice sent to Xfinity customers in Philadelphia said the price of Starz would drop to $8.99 starting Dec. 20, though that was before Monday’s announcement.

Comcast has said it wants to offer Starz as a direct-to-consumer subscription service instead of bundling it in packages. Doing this would allow customers who want Starz to subscribe without forcing others to pay for it, Comcast has said. The cable giant has noted that Starz allows its content to be sold a la carte through Amazon Prime, Roku, and its own app for $8.99.

In a recent earnings call, Lionsgate CEO Jon Feltheimer acknowledged that the TV landscape is “a different universe today.” As the industry shifts to a subscription streaming model, Starz is seeking to “pivot to a future of higher revenue, a la carte subscribers."

Feltheimer added that in 2019, more than half of Starz’s revenue came from a la carte customers for the first time.

Comcast’s video subscribers make up roughly 40% of Starz’s customer base, according to October estimates from Evercore ISI, a New York-based investment advisory firm.

Disputes over how much distributors such as Comcast pay to carry movies and shows from content makers such as Starz have become more contentious in recent years as consumers flee pay TV for cheaper online streaming options such as Netflix, Hulu, and Sling TV. Comcast has lost hundreds of thousands of cable TV customers every quarter even as its broadband business booms.

Lionsgate shares were up 8.27% to $10.87 on Monday. Lionsgate shares have plummeted over the last two years, from a high point of about $35 in January 2018.

Comcast shares were flat at $44.10.