Disney is now the only one with its hands on Hulu’s steering wheel.

Disney and Comcast announced a deal under which Disney will assume full operational control of Hulu, effective immediately. Within five years, Comcast has agreed to sell its Hulu stake to Disney for at least $5.8 billion.

Under the deal, Comcast’s NBCUniversal will continue to license content to Hulu through late 2024. However, as soon as next year, NBCU will have the right to pull back programming previously licensed exclusively to Hulu (continuing to make it available to Hulu on a nonexclusive basis for a reduced licensing fee). And by 2022, NBCUniversal will have the right to cancel most of its content-licensing agreements with Hulu. NBCU is planning to launch a free, ad-supported streaming service for pay-TV subscribers.

“We are now able to completely integrate Hulu into our direct-to-consumer business and leverage the full power of The Walt Disney Company’s brands and creative engines to make the service even more compelling and a greater value for consumers,” Disney chairman/CEO Bob Iger said in a statement about the pact.

With full operating control, Disney will have the latitude to set a new strategic road map for Hulu, including launching the service internationally.

The agreement was clinched between Disney and Comcast very recently — and parts of the deal are still being hammered out, industry sources said. For Disney, it was important to be able to present the deal giving it full control over Hulu for the Mouse House’s uber-upfront presentation to advertisers Tuesday in New York.

Comcast/NBCU will retain its 33% ownership interest in Hulu. As early as January 2024, Comcast can require Disney to buy NBCU’s interest in Hulu. By the same token, Disney can require NBCU to sell its interest to Disney for its fair market value at that time, the companies announced Tuesday.

Disney has guaranteed a sale price for Comcast’s stake in Hulu that will represent a valuation for the streaming-video joint venture of at least $27.5 billion. The companies said that when the sale of NBCU’s stake occurs in 2024, Hulu’s fair-market value will be “assessed by independent experts.”

NBCU CEO Steve Burke called the Hulu deal with Disney “a perfect outcome for us.”

“We believe strongly in the direct-to-consumer space and our content is a key driver of that ecosystem,” Burke said in a statement. The extension of the Hulu content-licensing agreement “will generate significant cash flow for us, while giving us maximum flexibility to program and distribute to our own direct-to-consumer platform, as we build that business. Significantly, this transaction also affirms the value of our stake, provides a path to liquidity and ensures our continued equity participation in Hulu’s success.”

Comcast agreed to extend the Hulu license of NBCU content and the carriage agreement for Hulu’s live TV service for NBCU channels until late 2024 and also to distribute Hulu on its Xfinity X1 platform. Comcast plans to integrate Hulu’s SVOD service into X1 and Flex by the end of 2019 or early 2020, available to customers who have a Hulu subscription.

But NBCU can nix most of the licensing agreements by 2022, the companies said. NBCU’s streaming service, set to bow next year, will feature “new originals and a gigantic library of old favorites… The shows that viewers stream the most are coming home,” Linda Yaccarino, NBCU chairman of advertising and client partnerships, said at the programmer’s upfront event Monday. It will be free to cable and satellite TV users and available for a subscription fee to non-pay-TV users.

Last month, AT&T sold its 9.5% stake in Hulu to Disney and NBCU for $1.43 billion, valuing Hulu at $15 billion. Disney and Comcast agreed to allocate that purchase on a pro-rata basis, giving Disney a two-thirds ownership position and Comcast/NBCU a 33% equity stake.

Disney secured 60% ownership of Hulu after it acquired the entertainment assets of 21st Century Fox for $71 billion, and was actively looking for a path to secure 100% of the company in talks with Comcast.

What Comcast’s Hulu ownership stake will be worth in five years is subject to how much money it continues to invest in the JV.

Comcast will have the option to fund its proportionate share of Hulu’s future capital requirements, but the conglomerate isn’t required to do so. Hulu has been investing more — and losing more — over the last few years. For 2018, Hulu lost around $1.5 billion, up from $920 million a year earlier, as calculated based on the proportionate loss reported by Comcast. According to Disney, Hulu’s capital funding calls to its two remaining parents will be capped at $1.5 billion per year (and if it requires more than that, Hulu will fund that via non-diluting debt).

If Comcast chooses to not continue funding Hulu going forward, its share will be diluted. Regardless of that decision, Disney has agreed that Comcast’s ownership interest in Hulu will never fall below 21%; in other words, Disney has guaranteed it will pay Comcast at least $5.8 billion to buy out the Comcast/NBCU stake.

Disney sees Hulu as a key pillar in its direct-to-consumer strategy, serving as a home to more adult-oriented entertainment fare alongside the upcoming Disney Plus (launching in November in the U.S.) and the ESPN Plus sports package. Disney says it’s likely the trio of streaming services will be bundled together at a discount at some point.

At the Disney Investor Day on April 11, Disney CFO Christine McCarthy projected Hulu’s paid subscriber base will hit up to 60 million by the end of fiscal year 2024. That would be more than double the 26.8 million paid subs Hulu announced it had as of earlier this month (up 16.5% from the end of 2018).

McCarthy also told analysts that Disney expects Hulu’s operating losses to peak at $1.5 billion in Disney’s fiscal year 2019 (which ends in September), with Hulu achieving profitability potentially as soon as fiscal year 2023.

Cynthia Littleton contributed to this report.