The Comcast Center in Philadelphia (AP/Matt Rourke)

NEW YORK  — Comcast made a $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 after AT&T’s decisive legal victory over the government to buy Time Warner.

The offer sets up a battle of wills between two of the most dominant and deep-pocketed entertainment companies in the world — Walt Disney, which proposed a $52.4 billion offer for Fox last year, and Comcast, the nation’s leading cable company which already owns Universal Studios and NBC.

Such merger proposals are 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, analysts said. The stocks of entertainment companies soared Wednesday, as investors grew giddy at the prospect of big conglomerates opening their wallets to buy ailing film and television studios.

The impetus to own content has become even more urgent as technology has disrupted the traditional ways consumers get shows and movies. Americans increasingly are consuming entertainment on their smartphones or over high-speed internet connections, rather than on living room television plugged into cable outlets. And the coming advent of a new ultra-fast wireless technology called 5G is expected to accelerate the trend.

That has left cable, telecoms and tech giants urgently searching for premier content they can control, which would make them more immune to shifting technologies. Beyond AT&T and Comcast, Apple, Google and Amazon have all moved into producing or buying original programming. Meanwhile, Disney is planning to launch a streaming app next that will enable it to reach consumers directly and compete with companies such as Netflix.

“We’re dealing with huge companies that have the financial value greater than some countries,” said Mary Ann Halford, a global media strategist at OC&C Strategy Consulting, said of tech giants moving into entertainment. “If [legacy entertainment] companies don’t step up now this could be a death-knell for them the way digital media was for parts of the newspaper industry.”

Whether the wave of consolidation impacts the shows themselves remains to be seen. Many independent producers fear that 21st Century Fox — which produces prestige films such as “The Shape of Water,” which won the Oscar for Best Picture, and “Atlanta,” the fiercely independent show on FX — would see changes either in the hands of Disney, which doesn’t emphasize such content, or NBC Universal, which already has several similar enterprises.

Fox film chief Stacey Snider, who has been actively pursuing new projects as the days of the studio as a standalone entity are numbered, told The Post earlier this year “I do feel like it’s the end of an era; I’m not sure what the studio will look like after an acquisition.”

Some companies have worried whether the government would block some of these deals, especially those between companies in different lines of business. But such concerns are waning in the wake of AT&T’s win in court over antitrust regulators. Less than 24 hours after the ruling, Comcast announced its offer for Fox.

Its fight with Disney 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.

The original agreement between Disney and Fox in December called for Rupert Murdoch’s company selling 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. Many analysts now expect Disney to raise its offer.

But more than money distinguishes the competing bids from Comcast and Disney. By adding shows like “This Is Us” and movie franchises like “Avatar” to its rich stable of Star Wars, Pixar, and Marvel movies, Disney would gain a commanding position in the entertainment world, enabling it to better dictate terms to theater and cable companies and entice millions to subscribe to its upcoming streaming service.

Comcast presents a different vision of a media company. It built itself into a powerhouse by becoming the largest cable service provider in the country and then bought up some of the best-known content in Hollywood. In contrast to Disney, it said it could use its knowledge of subscription and distribution relationships with consumers to enhance Fox’s reach. “We have real experience with distribution that couple apply to Fox’s business around the world,” Comcast executive vice-president Steve Burke said in a conference call Wednesday afternoon.

“It’s the same pillow but different dreams,” Todd Klein–a partner at the D.C.-based private-equity firm Revolution Growth who specializes in media and entertainment–said of Comcast and Disney’s models. “They want to get to the same destination but they’re coming from opposing places.”

Comcast desires more 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.

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. The Murdoch family owns about 17 percent of Fox shares.

Fox has given no hint of where it was leaning. In a statement Wednesday, the company said it “has not yet made a determination, in light of Comcast’s proposal, as to whether it will postpone or adjourn the July 10, 2018 special meeting of stockholders to consider certain proposals related to the Disney Merger Agreement.” Disney did not respond to a request for comment.

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 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 Comcast chief executive Brian 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.