Justin Timberlake pleaded guilty to a reduced charge of driving while impaired during a court appearance on Long Island. Timberlake agreed to 25-40 hours of community service and a fine as part of the deal.

Judge Carl Irace, who had suspended Timberlake’s license, asked if he would volunteer at a nonprofit, which Timberlake accepted. Outside the courthouse, Timberlake acknowledged his mistake, urging others not to drink and drive.

The Grammy winner was arrested in June after running a stop sign and failing a sobriety test in the Hamptons. He admitted to having “one martini” before driving. The district attorney praised Timberlake for taking responsibility and using his platform to raise awareness about the dangers of impaired driving.