This year’s most dramatic hostile takeover battle finally came to an end Friday, as pharmaceutical company Mylan failed to acquire generic drugmaker Perrigo. Mylan had launched a $26 billion tender offer directly to Perrigo shareholders more than two months ago, but it received too few takers to gain majority control of its target.

It was the finale of an engrossing M&A saga that began as a love triangle in April, when generic drug giant Teva TEVA tried to acquire Mylan MYL , and then turned into a two-way war of words between Mylan and Perrigo PRGO , which fought the hostile bid fiercely. (For more of the backstory on Mylan’s drama this year, read Fortune’s profile of Heather Bresch, “Why Wall Street loves to hate Mylan’s CEO.“)

Mylan, one of the world’s largest generic drug companies, was always facing an uphill battle in its attempt for Perrigo, the leading maker of drugstore-brand products. That’s because it’s very difficult to take over a large corporation that is determined not to be sold, and rarely do deals happen under hostile conditions: Since 2000, completed takeovers of unwilling targets have been worth less than $10 billion each, according to Dealogic. More often, a takeover target that starts out hostile will eventually give in after the acquiring company raises its offer or the target finds a so-called white knight to buy it instead.

With Perrigo, however, Mylan had slightly better odds. In 2013, Perrigo inverted to Ireland, where corporate anti-takeover provisions are weaker, so Mylan was able to bypass Perrigo’s CEO and board and make an offer directly to the company’s shareholders.

But Mylan still faced significant challenges. For example, its stock price fell significantly after Teva dumped it in favor of a deal with Allergan AGN , lowering the value of Mylan’s offer for Perrigo so much that it sometimes equated to a mere 3% premium (a fraction of the 34% average premium for health care deals last year). “This offer isn’t even in the right zip code,” Perrigo CEO Joseph Papa told Fortune recently.

Mylan was also under scrutiny for its governance practices, disclosing last month that the SEC is investigating some of its real estate transactions for potential conflicts of interest with board members.

Indeed, there were so many twists and turns during the takeover battle that it was impossible to predict whether the deal would succeed or not; investors sometimes gave it coin-flip odds—or less.

While influential proxy advisors recommended that Mylan’s own shareholders vote against the deal, some of Mylan’s top shareholders including renowned hedge fund manager John Paulson publicly expressed support for acquiring Perrigo and voted accordingly.

Mylan, however, clearly believed it would win, even going so far as to join the Tel Aviv stock exchange last week in an effort to gain the Israeli shareholders who owned roughly 12% of Perrigo. And as recently as Tuesday, Mylan issued a press release announcing that it was “highly confident” it would succeed in completing the deal, while Perrigo said it was just as sure its shareholders would reject it. Mylan, of course, will incur the cost of overconfidence, after spending millions on bankers, lawyers, and other fees to come up empty-handed.

Despite the months of bitter drama, both Mylan and Perrigo struck an upbeat tone as they reflected on the outcome of the bid Friday. “As we have said all along, Mylan viewed Perrigo as a unique and exciting opportunity, but not one that was required for the future success of our company,” Mylan executive chairman Robert Coury said in a statement. Perrigo CEO Papa responded: “We have said all along that this offer from Mylan was a bad deal … I am delighted that Perrigo shareholders voiced their clear support for this management team and our long-term strategy.” And in a nod to the fight Perrigo put up, Papa added that the company managed to keep going “even with all the distraction over the past seven months.”

Read an excerpt about the deal from Fortune’s profile of Mylan:

Nor does Bresch subscribe to the Big Pharma playbook. The deal doesn’t conform to the shareholder-friendly formula currently driving other mergers in the sector: Mylan isn’t predicting an immediate earnings boost from the deal; Perrigo doesn’t have a hot new drug, and it won’t greatly expand Mylan’s share of the prescription generics market. The leader in “white-label” generic over-the-counter products, Perrigo dominates the market for cheaper, drugstore-brand versions of Advil and Neosporin. Owning Perrigo would thus make Mylan a more diversified health care company, putting it both behind and in front of pharmacy counters.

Bresch managed to sell that vision to a majority of her shareholders, who approved pursuing Perrigo on Aug. 28, with 66% of the vote (against the recommendation of influential proxy advisory ISS). It will be harder to persuade Perrigo’s shareholders to take the deal, especially since the sinking price of Mylan’s shares has sharply lowered the value of the bid. “This offer isn’t even in the right zip code,” Perrigo CEO Joseph Papa tells Fortune in an email.

Bresch will have until Nov. 13 (the deadline for Perrigo investors to tender their shares) to win them over. If she succeeds, the roughly $35 billion deal would be the largest hostile takeover in history, according to Dealogic. But if there’s one thing Mylan and Bresch are comfortable with, it’s hostility. Bresch slips back into plain-speaking West Virginia mode as she describes what will happen when—not if—the bid succeeds: “We will absolutely embrace them, and they will see and feel our authenticity.”