A planned five-day strike by Asda warehouse staff has been called off, unions have confirmed.
The strike could have caused significant disruption
The action had been due to begin on June 30 after thousands of workers voted for industrial action in a dispute over pay and bargaining rights.
The decision followed prolonged negotiations between unions and the supermarket chain at the TUC.
Asda was about to seek an injunction to block the action, claiming "irregularities" in the strike ballot.
The GMB union said it was pleased with the agreement, which will see a new consultative body set up to for staff and managers to discuss issues at a national level.
"This new agreement heralds a new, fresh approach to representation and bargaining between the company and the GMB," said Paul Kenny, the union's general secretary.
The dispute centred around Asda's unwillingness to allow unions to negotiate nationally on behalf of staff at Asda's 24 depots.
Local collective bargaining is currently in force at nine Asda depots, but there are a further 11 depots at which unions are not recognised - which Asda says is due to low levels of union membership.
The two sides also disagreed over profit-related bonus pay.
Almost three-quarters of those who voted in the strike ballot - which took place at 20 of the 24 sites - supported the walkout.
However, the two sides disagreed over how many union members there were and how many would have taken part in a strike.
Only 16% of the firm's 13,900 depot staff had voted for industrial action, Asda said.
Asda - owned by US retail giant Wal-Mart - insisted that it was not opposed to union representation, and that it had come up with a "good offer" to resolve the dispute.
As well as maintaining existing bargaining agreements, it said it was prepared to set up agreements at other depots where most staff are in favour and where there is sufficient union representation.
"We are pleased to have signed an agreement acceptable to both sides to end the current dispute - good news for our customers and colleagues alike," said David Cheesewright, Asda's chief operating officer.
A strike could have caused major disruption over one of the busiest weekends of the year, with the World Cup and Wimbledon in full swing.
The depots that would have been affected included those at Bedford, Chepstow, Dartford, Didcot, Erith, Falkirk and Grangemouth.