Dressed in a navy blue suit, light blue shirt and matching striped tie, Dourdan casually flashed the peace sign as he left court, got into the back of a waiting car and drove away.
He was charged with three counts of felony drug possession following his April 28 early-morning arrest in Palm Springs, Calif. The heroin count was dismissed.
"As a result of today's proceedings, Gary has been given diversion (a drug treatment program)," his lawyer, Shawn Chapman Holley said outside the Lawson Justice Center. "He very much regrets what happened and he's very embarrassed by what occurred, but he's looking forward to moving on and getting back to work."
Dourdan had faced up to three years and eight months based on the charges filed against him. Instead, he faces no prison time, but must complete the 16-class drug program.
Holley added: "He is very grateful to the court for being understanding and giving him an opportunity to resolve the issue and move forward."
The Weekend of His ArrestPolice spotted Dourdan, 41, sleeping in his car on the wrong side of the street. He was charged with possession of cocaine, heroin and Ecstasy and released on $5,000 bail.
The weekend before his arrest, Dourdan attended the Coachella Valley Music & Arts Festival in nearby Indio, Calif.
"Obviously, I am embarrassed to find myself in this situation," he said in a statement to PEOPLE, "and I am profoundly grateful to everyone for their support."
Dourdan played Warrick Brown in the popular CBS crime show. In the season finale, a crooked officer shot his character twice in the neck. A show source said it was common knowledge that Dourdan's contract was up at the end of the season.
His rep said Dourdan was preparing to star in a French horror film called Black Jack, where he plays an American soldier who parachutes into a French village exposed to chemical warfare during World War II.
Like this story? Click on the Yahoo Buzz! button below to Buzz it up!