NEW YORK — Comcast made a stunning $65 billion bid Wednesday for 21st Century Fox in what is expected to be the first of many attempts to buy up pieces of the entertainment world in the wake of AT&T’s decisive legal victory over the government to buy Time Warner.

Comcast’s offer sets up a battle of wills between two of the most dominant and deep-pocketed entertainment companies in the world – Walt Disney and Comcast, the nation’s leading cable company which already owns Universal Studios and NBC. Comcast’s offer is about 19 percent higher than what Disney offered late last year.

But the headline-grabbing bid is unlikely to be the last to be announced in the coming months, given the government’s failed attempt to stop AT&T from purchasing Time Warner. Media and entertainment stocks soared Wednesday on speculation of a wave of consolidation in the industry.

Comcast’s is an all-cash deal at a significant premium over Disney’s $52.4 billion all-stock package. Its move will likely trigger a new offer from Disney and even a bidding war as two media giants battle for dominance both at home and overseas.

The fight will play out in real time over the next week as Fox readies for a scheduled board meeting on June 20 at which the issue will be raised. A meeting with 21st Century Fox shareholders on July 10 to discuss the offers will further cement the company’s fate.

Comcast Pictures, had been waiting to see if the courts were willing to condone vertical integration – the combining of two dissimilar businesses – before proceeding. With the ruling Monday in favor of the tie-up of a telecom and content company, the company now believes it has a green light.

Executives from Disney and Fox announced in December they had agreed to a deal that would see Rupert Murdoch’s company sell many of its assets, including his film and television studios, National Geographic, a 30 percent stake in Hulu and its 39 percent stake in European cable giant Sky to Disney for $52.4 billion in stock.

But as the deal has been awaiting government approval, Comcast, led by chief executive Brian Roberts, has been preparing its own bid, taking another run at a company it has long coveted and hoping to sway Murdoch and shareholders with a sweeter offer.

Comcast and Disney desperately want Fox for their own reasons, analysts say.

Disney hopes to build a massive stable of content as it competes with tech giants like Netflix and Amazon, populating its own streaming service with as many proprietary shows and movies as possible.

“We’re excited about this extraordinary opportunity to significantly increase our portfolio of well-loved franchises and branded content to greatly enhance our growing direct-to-consumer offerings,” Disney chief Robert Iger said at the time of the Disney-Fox announcement.

For its part, Comcast wants content that can help it beef up its own digital offering – possibly via Hulu, in which it would own a majority stake if it won Fox. It also could use some film franchises. And it urgently needs an international presence.

“For Comcast, this is a must-win,” BTIG analyst Rich Greenfield told The Post. “It’s the most landlocked company out there. Fox is its only real shot for it to become a global company.” Also part of the deal is Asian entertainment giant Star India, which Fox owns.

And Comcast could come out a winner on the remaining 61 percent of Sky, which Fox has sought to buy amid a tangle with European regulators, and which Comcast openly covets as well.

Murdoch would be deeply enriched either way-while still retaining Fox News, the Fox television network and other non-scripted assets he is believed to prefer.

Disney stock would offer an ownership position in an entertainment conglomerate; Comcast’s cash would line his pockets but take him out of the realm of much film and television production.

“Is it take-the-money-and-run or is it take less money and stay in the Hollywood game?” said a high-ranking Hollywood figure at none of the involved companies who follows the situation closely, framing one way of viewing Murdoch’s choice. The Murdochs own about 17 percent of Fox shares.

The markets took heart in what the news meant for Fox, with investors sending the stock up 7 percent since the close of trading Tuesday. Comcast has inched up 3 percent while Disney remained flat.

The fight over Fox would play out on the largest possible corporate stage. Comcast and Disney are the country’s two largest media companies by revenue. (Google’s Alphabet, Inc is bigger, but it focuses heavily on the tech space.) And in addition to pitting two entertainment giants against each other, a bidding war would set up a square-off between Iger and Roberts, who have a tense history dating back to a failed hostile takeover bid of Disney in 2004.

Other deals are expected in the wake of Tuesday’s ruling, with Verizon on the hunt for a content company, Lionsgate in search of a buyer and any one of several scenarios playing out in the long-running drama over CBS and Viacom.

But Fox’s size ($28.5 billion in annual revenue in 2017) and franchises (they range from “X-Men” to “Modern Family”) make it a prize neither Comcast nor Disney feel they can pass up. This is “the last remaining transformational deal in media,” wrote Jefferies analyst Scott Goldman in a recent note.

Only subscribers are eligible to post comments. Please subscribe or to participate in the conversation. Here’s why.

Use the form below to reset your password. When you've submitted your account email, we will send an email with a reset code.