The Madrid labour court said in Thursday's ruling the tech giant would have to pay Social Security contributions for the 2,166 people it hired under the guise of external contractors within the now-defunct "Amazon Flex" scheme and recognise them as regular staff during the periods they made deliveries.It did not provide the total to be paid.Amazon scrapped the Flex programme in Spain last year, after a 2020 Supreme Court ruling forced companies to hire freelance couriers as staff and the government introduced a pioneering law to the same effect in 2021."Amazon is a company that is not only a logistics and transport operator, but also a courier and messenger service provider," the judge said. The company has repeatedly argued that it is not in the transportation business. It did not immediately respond to a request for comment on the ruling, which is subject to appeal. According to the court, Amazon made all decisions related to the service - including schedules, geographic distribution and remuneration - and used an app to direct and coordinate the couriers, who "lacked their own and autonomous business organisation"."This ruling is one of dozens that ratify that the gig-economy model used by digital platforms is a massive fraud," Ruben Ranz, a spokesperson for trade union UGT, told Reuters on Friday."We're happy with the result and especially happy that this Amazon Flex model no longer exists," Ranz added. (Reporting by David Latona, Emma Pinedo and Inti Landauro; Editing by Andrei Khalip and Frances Kerry)