The Irish company that owns Magners cider is buying part of the UK's biggest alcoholic drinks distributor.
The wholesale division of Conviviality, which collapsed last week, is being bought by C&C in a pre-pack administration.
Conviviality brands including Matthew Clark and Bibendum are included in the deal, which is backed by AB InBev.
Conviviality said last week it planned to appoint administrators, putting 2,600 jobs at risk.
The move followed the discovery of a £30m tax bill and a series of profit warnings.
The Bargain Booze and Wine Rack retail chains, which are also owned by Conviviality, are not included in the deal and remain up for sale.
The wholesale division employs about 2,000 people and it is not clear how many jobs will be saved.
Stephen Glancey, C&C chief executive, said: "The last few weeks have been challenging for employees, customers and suppliers alike. We hope today's announcement can put an end to this period of disruption and uncertainty."
Matthew Clark and Bibendum were "great businesses" and well known to C&C, he added.
Conviviality supplies all the wine and spirits to 900 Wetherspoon pubs, making the chain one of the firm's biggest customers.