A law equating heroin with cannabis has been struck down in Italy, in a decision that may see 10,000 released from prison.

The country’s constitutional court ruled the law was “illegitimate”, without giving further details.

The law, which was introduced by former Prime Minister Silvio Berlusconi in 2006, has been blamed for causing prison overcrowding after sentences for selling, cultivating or possessing cannabis tripled.

Download the new Independent Premium app Sharing the full story, not just the headlines

After it was passed, marijuana and hashish became legally equal to cocaine and heroin, raising sentences associated with crimes from 6 to20 years, from 2 to 6 years previously.

According to prison rights group Antigone, 40 per cent of all inmates in Italian prisons were serving sentences for drug crimes.

Italian jails are the most crowded in the European Union, with around 62,000 detainees held in cells built for fewer than 48,000, official data states.

Following the verdict, the law in place prior to 2006 will once again take effect; under which crimes related to “hard” drugs like cocaine and heroin carry lengthier sentences than cannabis.

“The so-called drug war as conceived in North America has been lost and it's time to return to rational rules that distinguish between substances,” Franco Corleone, of the human rights group Society of Reason said.

But Senator Carlo Giovanardi, one of the original architects of the stricter law, said the ruling was a “devastating choice from a scientific viewpoint and in the message it sends to young people that some drugs are less dangerous than others”.

Additional reporting by Reuters