Phelps, 29, was sentenced to a year and a half of probation and a suspended one-year prison term after making his plea. Phelps told Judge Nathan Braverman that he learned from his mistake.
"I now have the tools to move past this," Phelps said. "What I did was wrong, and I made a bad mistake. I'm looking forward to having a much brighter future than I had in the past."
Braverman warned Phelps of the consequences of another slip-up.
"You don't need a lecture from the court," Braverman said. "If you haven't gotten the message by now, or forget the message, the only option is jail."
Phelps, an 18-time Olympic gold medalist, was arrested on Sept. 30 after police said he was driving erratically at high speeds in Baltimore, his hometown. He subsequently apologized via social media and began a six-week rehabilitation program.
Phelps was suspended by USA Swimming in October in a move that also bars him from competing in the 2015 world championships. The six-month suspension ends March 6, allowing him to swim in the final three events of the U.S. Grand Prix schedule.
In 2004, Phelps was sentenced to 18 months of probation after pleading guilty to drunken driving, also in Maryland. He also came under scrutiny in 2009 after the publication of a photograph that purportedly showed him inhaling from a marijuana pipe.
Phelps retired after the 2012 London Olympics but has launched a comeback, with a goal of competing in the