The two FTSE 100 firms confirmed the talks on Tuesday Morning in separate announcements, just weeks after Ocado boss Tim Steiner had stayed tight-lipped on speculation of a possible tie-up following newspaper reports in January.
There was also talk around the idea that M&S would use a potential partnership with Ocado to help push into the grocery delivery market where it has traditionally lost ground to competitors.
Shares in both the online grocer and the high street retailer were given a hefty boost in response to the news, with Ocado shares surging 10% to 974.4p while M&S jumped 4% to 305p.
The lift in the shares will be a welcome respite for Ocado after a fire swept through its Andover warehouse in Hampshire earlier in February, leading to the cancellation of thousands of customer deliveries and a subsequent cut to its sales growth forecasts.
The possible tie-up would also provide a boost to M&S as it seeks to find a way out of a downturn in the high street that saw its like-for-like sales drop over 2% during the important Christmas period in 2018.
If a deal is agreed, however, M&S would join six other retailers that Ocado has already signed up to its robotic warehouses, including FTSE 100 supermarket WM Morrison Supermarkets PLC (LON:MRW), Waitrose, and US grocery giant Kroger Co (NYSE:KR).
While the two companies did confirm the talks, they also added that there was “no certainty” that the discussions would result in any agreement.
Sophie Lund-Yates, equity analyst at Hargreaves Lansdown, said: “Investors will be breathing a sigh of relief on the back of this announcement, even though a deal isn’t definite.
"It’s enough to know Ocado has the interest of one of the biggest retail names in the UK, following the devastating fire at the Andover warehouse earlier this month."
The analyst added that if an agreement is announced, it would be a "real boost" for Ocado.