Robert Downey Jr. Shows Up for Son's Drug Plea

9/12/2014 8:00 AM PDT

Robert Downey Jr. Shows Up for Son's Drug Plea

Robert Downey Jr. showed up in court today to support his son Indio who pled guilty to drug charges -- but he could have a clean record in no time at all ... and the judge used Iron Man as inspiration.

Indio clearly impressed the judge with a glowing letter from his rehab facility -- where Indio has been since his arrest 2 months ago.  

Judge Keith Schwartz made a point of acknowledging Indio's famous dad by saying, "I know in life people always look up to superheroes, but I think you might have contact or an inside as to one superhero -- that's Iron Man."

Indio pled guilty to felony cocaine possession -- but the judge said the conviction will be wiped clean if Indio stays clean and sober for 18 months and finishes his program.

Indio is prohibited from being around anyone who sells, buys or uses drugs.

The courtroom scene was moving ... As Indio and his lawyer, Blair Berk, faced the judge, Robert -- who has his own history with drug addiction which he has kicked in breathtaking form -- watched attentively.