Thousands of tonnes of waste clogged the streets of Naples
The EU's top court says Italy breached an EU directive on waste disposal by allowing piles of rubbish to litter the streets of Naples in 2007-2008.
The directive became law in Italy in 2006, but the European Court of Justice says the waste disposal sites in the Naples area were inadequate.
The European Commission brought the case against Italy, which must now comply with the court's judgement.
The court says the piles of rubbish endangered health and the environment.
Failure to comply with the judgement could lead to a hefty fine for Italy.
The Italian authorities and Naples residents have long accused the local version of the Mafia, the Camorra, of dumping huge amounts of industrial waste from the north not only in the Campania region's landfill sites but also in the countryside.
The Camorra is accused of infiltrating the waste disposal business and profiteering from it.
To deal with the Naples crisis the Italian government opened up several new waste incinerators in Campania.
Troops were also brought in to help clear the rubbish and there were sporadic clashes with locals enraged at the mess plaguing their streets for months.
But the court ruling on Thursday says Italy has failed to set up an adequate network of waste disposal installations as close as possible to the areas where waste is produced.
"By failing to adopt all the measures necessary to prevent danger to human health and damage to the environment in the region of Campania, Italy has failed to fulfil its obligations under the Waste Directive," the judges said.