The judge overruled a prosecution request for the 37-year-old actor's probation to continue for a further six months to ensure ''aftercare'' drug rehabilitation.
Downey Jr's lawyer, Jim Epstein, said his client was ''absolutely ecstatic and very optimistic he'll be able to stay sober and get movie parts again''.
San Bernardino Superior Court Judge Randall White decided Downey had complied with his probation terms, handed down a year ago after being convicted of cocaine possession and being under the influence of drugs.
Troubled past
Downey Jr had been arrested in November 2000 near Palm Springs when found with a small amount of drugs.
"
After pleading no contest to the charges, Downey Jr was ordered to undergo drugs rehabilitation treatment instead of being sent to prison under a new California state law that came into force shortly before he was sentenced.
His legal troubles began in 1996 when he was caught with cocaine, heroin and a pistol in his vehicle.
In August 1999, Downey Jr was sentenced to three years in prison for violating probation by missing scheduled drugs tests, but served only one year.
Downey Jr, nominated for an Oscar for the 1992 movie Chaplin and for an Emmy for Ally McBeal, told Judge White he was serious about staying out of trouble.
But Deputy District Attorney Kevin Shek, arguing for an extension of the probation, said: ''He did well, but the law allows an additional six months of aftercare. That would have been appropriate given his history of substance abuse.''