Time Warner is buying 10% of Hulu, the company announced on Wednesday.

It spent about $580 million for the stake, according to a person familiar with the matter. That values Hulu at nearly $6 billion.

Time Warner also signed an affiliate agreement for its full suite of networks including CNN, Cartoon Network, and TBS to stream on the new service Hulu is launching early next year.

Time Warner originally wanted a 25% stake in Hulu, The Wall Street Journal reported in January. It's all part of its effort to win back cord-cutters who are ditching cable-TV bundles for cheaper on-demand services.

Time Warner is joining Disney, Comcast, and 21st Century Fox — its old owners — with its stake Hulu.

"Our two companies have long enjoyed a productive relationship — which includes the availability of past seasons of popular Turner shows on our current SVOD offerings — and we are very proud that Turner's networks will be included in our planned live streaming service," Hulu CEO Mike Hopkins said in a statement.

Hulu will still offer its video-on-demand products and work to create more original programming.

Time Warner shares rose by as much as 1% in premarket trading. The company also announced second-quarter earnings that were better than analysts had expected and raised its full-year forecast.

Adjusted earnings per share came in at $1.29 (versus $1.16 expected, according to Bloomberg), while revenue fell 5% year-on-year to $7 billion.

(Additional reporting by Nathan McAlone)