Gibson, 50, pleaded no contest Thursday to a misdemeanor charge of driving with an elevated blood-alcohol level and was sentenced to three years probation, the L.A. County District Attorney's office announced in a statement.
Gibson did not appear in court; his lawyer, Blair Berk, entered the plea on his behalf before Malibu Superior Court Judge Lawrence Mira, deputy district attorney Gina Satriano said.
The case had originally been assigned to court commissioner Terry Adamson, who removed herself because Gibson is her neighbor. The case then went to Mira, who previously sentenced actor Robert Downey Jr. to jail on drug charges.
"This was an appropriate outcome which addresses all the public safety concerns of drinking and driving," Satriano said in the statement.
Under the terms of the plea deal, Gibson, 50, was ordered to attend Alcoholics Anonymous meetings five times a week for four and a half months and three AA meetings per week for an additional seven and a half months.
In exchange for the no contest plea to the charge of driving while having a .08 percent or higher blood-alcohol content, the two remaining charges, of driving under the influence and having an open container of liquor in his car, were dismissed.
Deputy D.A. Satriano said Gibson volunteered to enter rehab immediately and to do a public service announcement on the hazards of drinking and driving. His rep previously announced Gibson was seeking treatment for alcoholism.
Gibson was pulled over shortly after 2 a.m. on July 28 on Pacific Coast Highway for driving his 2006 Lexus LS at more than 85 mph.
He reportedly made anti-Semitic comments during his arrest, for which he later issued an apology.
Gibson's rep, Alan Neirob, had no comment.