The courtship between Disney and 21st Century Fox began over a glass of wine at Rupert Murdoch’s estate in Bel-Air on Aug. 9 and was sealed by a handshake and photo shoot atop a London high-rise on Dec. 12. Along the way, Comcast sailed in with a competing bid for Fox that offered more money — but with terms that made the 21st Century Fox board nervous about the cable giant’s ability to close the deal.

Disney and Fox revealed granular details of how the $52.4 billion merger agreement came to pass in a massive 455-page filing with the Securities and Exchange Commission late Wednesday. The mega-deal has jolted the entertainment industry as it marks a historic union of two of Hollywood’s Big Six studios. It also signaled the frenzy among traditional media heavyweights to bulk up content and distribution operations in the face of growing challenges from deep-pocketed tech giants including Facebook, Amazon, Apple, and Netflix.

After Disney chairman-CEO Bob Iger and 21st Century Fox chairman Murdoch first discussed the possibility of a deal on Aug. 9, Murdoch’s sons, 21st Century Fox CEO James Murdoch and Fox chairman Lachlan Murdoch, met with Lowell McAdam, CEO of Verizon (referred to as “Party A” in the filing), in New York, who proposed an all-stock deal “without any meaningful premium to 21CF stockholders,” according to the filing. That company would hover around the sale process for the next few months but never got any real traction.

Comcast, identified in the filing as “Party B,” engaged at length in November and in early December with John Nallen, Fox’s senior exec VP and CFO, and various Fox lawyers and bankers involved in the merger discussions. The detail provided in the filing casts doubt on Comcast’s assertion that the company “never got the level of engagement needed to make a definitive offer,” which it declared in a statement issued three days before Disney and Fox unveiled their pact on Dec. 14. The meeting-by-meeting timeline underscores how much of the discussion was steered by Iger and Rupert Murdoch.

Rupert Murdoch initiated the start of formal negotiations with a phone call to Iger on Aug. 29 indicating his willingness to get serious on a transaction. From Sept. 12-24, Fox’s Nallen and Disney’s Kevin Mayer, senior exec VP and chief strategy officer, huddled in secret to study possible structures for the transaction as well as regulatory and tax implications.

By Oct. 4, Disney and Fox had struck a confidentiality agreement that was backdated to Oct. 1. A raft of lawyers and bankers were engaged as part of the talks by Oct. 9, including Goldman Sachs, Guggenheim Securities, and JP Morgan Securities. Disney tapped the law firm of Cravath Swaine & Moore while Fox retained Skadden Arps.

The filing makes it clear how much time and energy was devoted to discussions of potential regulatory hurdles and the identification of the Fox assets that Disney would not acquire — primarily Fox Sports, Fox News, Fox Broadcasting Co. and the Fox Television Stations group. The assets that were targeted for purchase by Disney became known as “RemainCo” while the others were dubbed “New Fox.”

A large group of executives met in Oct. 17 in New York to discuss the financial performance of both RemainCo and New Fox assets. Fox executives also made their pitch to Disney on how the absorption of the 20th Century Fox studio, FX Networks, National Geographic Worldwide, Fox’s international channels, and Fox’s stake in Sky and Hulu would benefit both sides. And Fox offered its estimate of annual cost savings Disney would realize by consolidating the RemainCo assets. The group at this meeting included Rupert, Lachlan and James Murdoch, Nallen, Gerson Zweifach, Fox’s senior exec VP and group general counsel alongside Iger, Mayer, Disney general counsel/senior exec VP Alan Braverman, and Disney CFO/senior exec VP Christine M. McCarthy.

On Oct. 25, Iger and Rupert Murdoch met to discuss the deal that was shaping up. Murdoch at that time raised his view of the importance of Iger remaining on board as Disney chairman-CEO in order to steer the integration of the assets. Iger’s contract, which had been set to expire in mid-2019, would ultimately be extended through the end of 2021. At another meeting that day, the Disney team presented the overview of their businesses to the Fox group.

Lawyers and bankers met steadily throughout the rest of the month. Disney’s initial offer took shape at $60 billion valuation for the Fox assets to be paid 40% in cash and 60% in stock. On Oct. 28, Rupert Murdoch called Iger to tell him the talks “should cease” and that Disney’s offer had been deemed “inadequate from a value perspective.”

Mayer continued to study the valuation question with Goldman Sachs reps in early November. On Nov. 6, the temperature was raised a few degrees when CNBC broke the news that Fox and Disney had been talking about a deal. The 21st Century Fox board of directors held a meeting that day by conference call in which Rupert Murdoch informed them the board about the Disney discussions and the overture from Verizon. The board supported Murdoch in continuing to pursue conversations with potential suitors.

Also on Nov. 6, Comcast chairman-CEO Brian Roberts reached out to Rupert Murdoch expressing his desire to talk about a possible deal. The following day, Disney’s Mayer called Fox’s Nallen to indicate Disney’s willingness to raise its offer. Meanwhile, Fox’s bankers began discussions with Comcast reps.

Team Fox continued discussions on two tracks. Verizon also resurfaced in early November to reiterate its interest in Fox but only in an all-stock deal with no “meaningful premium” for Fox shareholders.

On Nov. 15, Fox held a regularly scheduled board meeting following its annual shareholders meeting. The board discussed the merits of the Disney deal and the emerging offer from Comcast. The board discussed the dangers of regulatory hurdles to cutting a deal with Comcast given its recent track record in Washington, or what the filing calls “prior strategic transactions pursued by Party B and the response of regulatory authorities to such transactions.”

The Fox board also discussed the fact that Fox’s prior statements in opposition to deals pursued by Comcast — such as Comcast’s ill-fated effort in 2014 to acquire Time Warner Cable — could be used against Fox if it were to seek a deal with Comcast.

Around this time, Comcast’s offer took shape at $34.41 a share, while Disney’s offer was up to $66 billion, or $28 a share and the rest in cash. Team Comcast suggested it would be willing to make divestitures of its existing holdings to get a deal done. But Team Fox was concerned about Comcast’s suggestion that the sides could maneuver around regulatory hurdles by shifting more assets into New Fox in the face of federal opposition.

The specter of the AT&T-Time Warner merger, which is now being fought out in a Washington, D.C. courtroom, hung heavily over these considerations as the board noted the Justice Department’s “unanticipated opposition” to a deal that had far less overlap in operations than would be a factor in a Comcast-Fox combination. Comcast also refused to agree to pay Fox a reverse break-up fee if the deal was scuttled by regulators, according to the filing, although Comcast did offer to agree to allow Fox to walk away from the deal if the Justice Department wound up blocking the AT&T’s acquisition of Time Warner.

By Nov. 21, Fox had executed a confidentiality agreement with Comcast. But the following day, Fox gave Disney access to a “data room” for a deep dive into the company’s books. Just after Thanksgiving, Fox and Disney were working on term sheets.

On Nov. 28, Fox held a board meeting via conference call to discuss the competing offers from Disney and Comcast. The panel came to the conclusion that a union with Disney was “a better strategic fit, with greater cost synergies and more opportunities for innovation, and the relative attractiveness of the resulting equity currency in a combined Disney-21CF.”

Team Fox’s discussions with Disney accelerated during the following week even as talks with Comcast continued. Rupert Murdoch, Nallen and Comcast’s Roberts and Comcast CFO Michael Cavanagh met again on Dec. 4 in New York. Comcast held fast to its refusal to offer a reverse breakup fee and pushed Fox to commit to exclusive negotiations. Three days later Rupert Murdoch called Roberts to tell him that talks would be “suspended” while Fox pursued “other opportunities.”

Comcast has since declared its intention to mount a rival bid for all of Sky, the European satellite platform that Fox has been trying to acquire outright since late 2016. Sky is a key pillar of Disney’s plan to build a global streaming platform enhanced by the library and content-generating operations of Fox.

The Disney and Fox camps worked furiously during the first two weeks of December to hammer out the basics of the deal — including the terms of how the RemainCo assets would interact with New Fox assets given the large amount of ongoing business between the soon-to-be-former corporate siblings.

Iger and Rupert Murdoch met Dec. 12 in London, where Disney held a glitzy premiere for “Star Wars: The Last Jedi.” The pair discussed the status of the advanced discussions and how their respective boards were feeling about the transaction.

The Disney and Fox boards would meet separately the following day to formally vote on the offer. But Iger and Murdoch were confident enough in London to take a photo shaking hands on the roof of a building overlooking St. Paul’s Cathedral. That picture would be distributed to media outlets when the deal was formally announced before the stock market opened on Dec. 14.

In the view of the Fox board, the union with Disney promises to “unlock the full value of 21CF’s widely recognized and appealing brands and enhance 21CF’s businesses’ ability to accelerate their growth and expand their ability to participate in the rapidly evolving global media and entertainment landscape,” according to the filing. “The mergers would allow 21CF stockholders to participate in the long-term growth of Disney, a leading global entertainment company with compelling storytelling, global reach and scale and an unsurpassed range of consumer relationships, extensive brands and breakthrough over-the-top media capabilities.”

Among other tidbits from the filing: