M&S will purchase Gist’s entire share capital for up to £255m from Storeshield, a subsidiary of The BOC Group.
The company will pay £145m in cash as an initial consideration followed by a further £85m, including interest, on the third anniversary of the deal’s completion.
It will also have to pay up to £25m more, as well as interest, ‘under certain conditions’.
Gist operates a network of eight primary and ten secondary distribution centres across the UK and Ireland, as well as a number of freehold warehouses.
The company provides most of M&S Food’s logistics services.
The acquisition will generate immediate benefits for the retailer by eliminating contractual fees and costs, as well as the implementation of aligned operational processes.
M&S chief executive Stuart Machin said: “M&S has been tied to a higher cost legacy contract, limiting both our incentive to invest and our growth.
“The last two years have shown what can be achieved by working collaboratively alongside our partners at Gist.
“This has given me confidence that now is the time to take action and remove an impediment to our growth.
“We have therefore acted decisively to acquire Gist, taking control of our Food supply chain for the first time in our history.
“This is the first step in a multi-year plan which will transform the entire supply chain.”
The acquisition is expected to add to M&S’s profits next year.
In May this year, M&S reported statutory revenue of £10.88bn ($13.68bn) for the financial year 2021/22 (FY22), up by 21.5% from the previous year.
The retailer’s sales before adjusting items grew by 21.6% year-on-year for the 52 weeks to 2 April.