MADRID (AP) — A Spanish court has ruled that Amazon broke labor laws by forcing more than 2,000 delivery drivers to use an app that the company controlled for scheduling work and payments and requiring them to use their own cars and cellphones on the job. Amazon could not treat workers using its Flex app as self-employed because the e-commerce giant's Spanish subsidiary "assumes the authority to make all decisions regarding the service, setting the conditions of execution and remuneration, and the circumstances of the day, time and duration" of labor, according to the Madrid labor court's decision released Friday. Amazon stopped using the Flex app in Spain in 2021. Friday's ruling is the result of a lawsuit brought by Spain's social security body following a 2019 labor inspection at an Amazon facility. The government agency is seeking to recoup payments that it says Amazon should have made on behalf of the drivers.