Deliveroo had argued that if riders were classed as workers, they would lose their current flexibility, which allows them to pick up orders as they wish, and be paid by the delivery, rather than working in shifts.

The IWGB said the ruling showed a majority of Deliveroo riders wanted workers' rights and union recognition.

The case follows a number of claims brought by workers in the "gig" economy demanding rights such as holiday pay, the minimum wage and pensions contributions.

It is a major victory for Deliveroo, which greeted the decision as a victory for riders, and comes just days after Uber lost a key appeal over its drivers' working rights.

The Independent Workers' Union of Great Britain (IWGB) had brought the case against Deliveroo, which has been criticized for not providing riders with benefits such as holidays and Britain's minimum wage.

"We find that the substitution right to be genuine, in the sense that Deliveroo have decided in [its new contract] that riders have a right to substitute themselves both before and after they have accepted a particular job".

Jason Moyer-Lee, the IWGB general secretary, said: "It seems that after a series of defeats, finally a so-called gig economy company has found a way to game the system".

Crowley Woodford, an employment partner at law firm Ashurst, said: "This will be a significant blow to the unions who are trying to expand their membership within the gig economy by challenging the basis on which such employers engage and use their labour".

Deliveroo said it was pushing to have employment law to be changed so it could offer its self-employed riders injury pay and sick pay.