UPDATE, 2/12/14, 4:00 p.m. EST: The ninth paragraph of this article has been updated to include the names of attorneys at Swiss firm Homburger who are working on the deal on behalf of Nestlé.

After four decades of partnership, Nestlé is whittling its stake in French cosmetics company L’Oréal by agreeing to sell back an 8 percent stake in the Clichy, France–based company—the world’s largest maker of cosmetics—in an $8.9 billion cash and stock transaction announced Tuesday.

Under the terms of the deal, L’Oréal has agreed to buy back 48.5 million of its own shares from Nestlé in a two-stage deal. The French company will first hand over its 50 percent stake in Galderma, a Swiss dermatology joint venture formed by L’Oréal and Nestlé in 1981, in exchange for 21.2 million L’Oréal shares at a value of roughly $4.2 billion. L’Oréal will then pay $4.65 billion in cash for the remaining 27.3 million shares, which the French company will cancel in order to increase its earnings per share by more than 5 percent.

As a result of the deal, Nestlé, L’Oréal’s second-largest shareholder, will cut its stake in the company to roughly 23.3 percent. L’Oréal’s largest shareholder, the Bettencourt family, will in turn increase its stake to 33.1 percent. The transaction is expected to close before the end of the first quarter, pending the approval of regulators and Galderma’s and L’Oréal’s respective works councils.

Nestlé—which bought its initial L’Oréal stake from the Bettencourts in 1974 as a way of helping the family ensure that the company would not be nationalized—was reported by Bloomberg last week to be looking to gradually reduce its holdings in the cosmetics maker as part of its strategy to focus on its core nutrition and health business. In announcing the stake sale Tuesday, Nestlé chairman Peter Brabeck-Letmathe confirmed that the deal played into his company’s long-term strategy, adding that Nestlé will specifically be able to expand its medical skin treatment offerings by taking full control of Galderma.

Nestlé, which will continue to work with L’Oréal as a major shareholder, will also see its presence on the French company’s board of directors trimmed from three directors to two as a result of the deal.

Orrick, Herrington & Sutcliffe is advising L’Oréal on the matter with a Paris-based team led by M&A partners Jean-Pierre Martel and Alexis Marraud des Grottes, along with associates Sophie Millet and Olivier Vuillod.

Paris-based firm Bredin Prat’s senior partner, Didier Martin, is advising the Bettencourt family, which is lending its support to the deal. Bredin Prat previously advised L’Oréal on its 2007 sale of a 1.8 percent stake in drug company Sanofi-Aventis for $2.2 billion.

Nestlé has also turned to a Paris-based firm as its legal counsel on the transaction: Darrois Villey Maillot Brochier, which is fielding a team led by M&A partners Emmanuel Brochier and Bertrand Cardi. Corporate partner Christophe Vinsonneau, tax partner Vincent Agulhon and competition partner Igor Simic are also advising on the deal, along with associates Constance Bocket, Damien Catoir, Olivia Chriqui, Charlotte Ferran and Nicolas Mennesson.

Swiss firm Homburger is also representing Nestlé in connection with the share sale. Zurich-based corporate partner Daniel Daeniker is leading a team from the firm that also includes corporate partner Frank Gerhard and tax partners Dieter Grünblatt and Reto Heuberger. Homburger advised the company last year on its sale of a 10.03 percent stake in food flavorings producer Givaudan for $1.27 billion.

In recent years, Nestlé has frequently turned to Mayer Brown for advice on acquisitions meant to boost the company’s health and nutrition portfolio. In 2012, for instance, the firm advised Nestlé on its $11.9 billion purchase of Pfizer’s infant formula business—an acquisition that came almost a year after the company hired Mayer Brown as legal counsel on its $1.1 billion purchase of pharmaceutical and diagnostic company Prometheus Laboratories