If you have ever taken old clothes to a recycling bank, be it in the UK or North America, there is a real chance that the garments ended up illegally dumped in a desert in northern Chile.

The South American country is one of the world's biggest importers of used clothing, but items that fail to be resold have for years been simply discarded in big piles out in the barren, bone-dry countryside. In response to a law change, one Chilean company is now moving to tackle the problem.

Chile imports 123,000 tonnes of used clothes every year, according to government estimates. The big driver of this is the free-trade port of Iquique in the north of the country.

Businesses in the city and surrounding towns can import, store and sell goods without having to pay customs duties or VAT.

Known as Zofri, which stands for Zona Franca del Iquique (Iquique Free Trade Zone), it was created in 1975 to boost economic and social development in northern Chile.

Used clothes became one of the biggest imports. They continue to arrive from the US, Canada, Europe and Asia, baled up in shipping containers. The clothing is either sold locally, or exported to other countries in Latin America.

Felipe González, the general manager of Zofri, says the 50 or so clothing import firms help the local economy. It's a sector that gives the most work to local women in the region, he says. Around 10% work with textiles.

Stall-holders sell everything from T-shirts, to jeans and dresses. The prices are cheap, starting from 500 Chilean pesos (54 cents; 42 pence). Tourists and locals flock here, especially at the weekend to find a bargain.

Although the clothes create jobs for the local economy, the issue remains about what happens to the stock that doesn't sell. It cannot go to the local council's landfill, because that can only be used for household waste, not commercial imports.

Some 39,000 tonnes are illegally dumped every year, according to the biggest estimates. It's a headache for Alto Hospicio's local authority. Miguel Painenahuel, who works in the town's planning department, says it is difficult to monitor and stop the dumping.

Elsewhere, a solution has emerged to turn the waste clothing into a business opportunity. Luis Martínez, the executive director of the Centro Tecnológico de Economía Circular (CircularTec), is leading a project to refashion and reuse unsold clothing.

A factory is being built that will find new uses for unwanted clothing. It is a business opportunity that complies with a recent law change requiring companies to handle textile waste sustainably.

Bekir Conkur, manager of the new factory, aims to process 20 tonnes of clothing a day and will turn textiles into reusable fibers to be used in insulating materials and furniture.

With these innovative measures, Chile hopes to address the urgent environmental crisis posed by the illegal dumping of clothing and set a precedent for sustainable textile management globally.