Nestle agreed to an $8.9 billion deal to sell an 8% stake in L’Oreal back to the cosmetics company, as the Swiss food giant continues to make cuts to its portfolio.

Nestle said Tuesday it will sell 48.5 million shares to L’Oreal, whose brands include Garnier and Maybelline. In exchange, Nestle will receive €3.4 billion, or $4.64 billion, in cash and L’Oreal’s half of joint venture Galderma, a skincare company.

The 50% stake in Galderma has an enterprise value of €3.1 billion, or $4.23 billion, according to Nestle.

Nestle’s ownership of L’Oreal will fall to 23.29% following the deal’s closing.

The company has been shedding assets of late, hoping to refocus its portfolio of more than 1,800 businesses on higher-growth areas. Last week, Nestle unveiled a deal to sell its PowerBar and Musashi nutrition brands to Post Holdings (POST). It also announced a deal in November to send its Jenny Craig diet business to North Castle Partners.

Paris-based L’Oreal is also in the midst of a revamp. The exit from Galderma, which makes treatments for acne and skin cancer, is part of the firm’s plans to focus primarily on cosmetics.

Speculation over a possible deal with Nestle heightened in recent weeks, since part of the arrangement between Nestle and the Bettencourt Meyers family, heirs of L’Oreal’s founder, was set to expire in April. Nestle first acquired a piece of L’Oreal about 40 years ago.

L’Oreal plans to cancel the shares it will receive from Nestle, thereby increasing the family’s stake to 33.31% from 30.6%.

Follow Matthew Rocco on Twitter @MatthewRocco