Warner Bros. Discovery is splitting itself into two stand-alone publicly traded entertainment companies, separating its HBO Max streaming service, movie studio and TV production business from its cable networks.

One company will be home to CNN, TNT, TBS and Warner’s dozens of cable channels, as well as its international holdings. That entity, called Global Networks for now, will hold as much as a 20% stake in the second entity, which Warner is referring to as Streaming & Studios. It plans to use earnings from that stake to pay off debt.

The move effectively undoes much of Warner Media and Discovery Communications’ 2022 merger, separating Warner’s marquee film and TV from Discovery’s reality and nonfiction fare.

Warner, like other entertainment companies including Disney and Paramount Global , has seen ratings and revenue decline in its once-powerful cable network operation, with consumers ditching traditional pay-television in favor of streaming. Comcast is in the process of spinning off the bulk of its cable network business into a stand-alone company named Versant that is expected to be complete by year’s end.

Warner is betting that its parts are worth more than the whole. Traditional media companies are trying to keep up with rivals such as Netflix and Amazon Prime Video that are unburdened by legacy cable businesses.

Warner told investors late last year that it planned to restructure into two operating divisions. It said Monday that the separation will unlock shareholder value and give each company the ability to be more nimble in a rapidly changing media landscape.

Warner Chief Executive David Zaslav will remain as chief executive of the Streaming & Studios company, while Chief Financial Officer Gunnar Wiedenfels will serve as chief executive of Global Networks.

“We are empowering these iconic brands with the sharper focus and strategic flexibility they need to compete most effectively in today’s evolving media landscape,” Zaslav said in a statement.

Zaslav is under increasing pressure to boost the company’s sagging stock price, which has dropped by about 59% since the company was created from the merger of AT&T ’s Warner Media and Discovery Communications.

S&P Global Ratings downgraded Warner debt to junk status earlier this month, primarily because of the challenges facing its cable-network business. Last week, more than 59% of Warner shareholders voted against the $51.9 million compensation package Zaslav received for 2024 in a symbolic rebuke of the Warner leadership’s pay packages.

The Warner-Discovery marriage has been tumultuous for employees of both companies. Several thousand employees have been laid off over the last three years, and the company has worked to cut costs and manage the staggering debt it took on to close the merger. Wiedenfels said Monday that the Global Networks company, where many of the cuts have already come, “will continue to be very focused on efficiency.”

Besides its U.S. cable assets, Global Networks will also house the Discovery+ streaming service, CNN’s planned streaming service and U.S. sports properties, including Bleacher Report.

A significant portion of Warner’s roughly $34 billion debt will live on the balance sheet of Global Networks, which currently generates more revenue and has stronger cash flow than Streaming & Studios. Though revenue from cable networks fell 6% in the quarter that ended March 31 from the prior-year period, they were still Warner’s largest revenue generator.

Warner said it also secured a $17.5 billion bridge loan from J.P. Morgan to buy back a chunk of its debt. After the separation, the two new companies will issue new debt to pay off the bridge loan.

Write to Joe Flint at Joe.Flint@wsj.com