The winningest athlete in Olympic history made the announcement in a series of posts on his Twitter account.
According to his representatives at Octagon, Phelps entered an in-patient program that will keep him from competing at least through mid-November, though there's no indication he plans to give up swimming.
"The past few days have been extremely difficult," Phelps said in a statement. "I recognize that this is not my first lapse in judgment, and I am extremely disappointed with myself. I'm going to take some time away to attend a program that will provide the help I need to better understand myself.
He added, "Swimming is a major part of my life, but right now I need to focus my attention on me as an individual, and do the necessary work to learn from this experience and make better decisions in the future."
The 29-year-old Phelps was arrested early Tuesday and charged with drunken driving in his native Baltimore. Police said he failed a series of field sobriety tests and had a blood-alcohol content of 0.14 per cent, well above the legal limit of 0.08.
Phelps retired after the 2012 Olympics in London, having won a record 18 gold medals and 22 medals overall. But he returned to competition this year with the goal of making the 2016 Rio Games.
His comeback has produced encouraging results, including three golds and two silvers at the Pac Pacific Championships in August.
Now, swimming is on the backburner.
A statement from Octagon said Phelps was entering "a comprehensive program that will help him focus on all of his life experiences and identify areas of need for long-term personal growth and development."
"Michael takes this matter seriously and intends to share his learning experiences with others in the future," the statement said.
While Phelps was still working out his schedule for the upcoming year, he will surely miss the first U.S. Grand Prix meet at Minneapolis, which begins Nov. 20. The remaining five Grand Prix meets are all in the first half of 2015 — important steps in the lead-up to next summer's world championships in Russia.
Phelps has already qualified for the worlds, the biggest meet on the swimming calendar outside of the Olympics. He was not planning to compete in the short course world championships, which will be held in early December in Qatar. The U.S. team for that meet, which includes longtime Phelps rival Ryan Lochte, was announced last week.
Chuck Wielgus, the executive director of USA Swimming, praised Phelps for entering a program. The governing body suspended him for three months in 2009 after a photo emerged showing Phelps using a marijuana pipe, even though he was not charged.
USA Swimming has not taken any disciplinary action for his second DUI arrest.
"We fully support Michael's decision to place his health and well-being as the number one priority," Wielgus said. "His self-recognition and commitment to get help exhibit how serious he is to learn from this experience."
Phelps was also charged with excessive speed and crossing double lane lines in the Fort McHenry Tunnel on Interstate 95, according to the Maryland Transportation Authority Police. An officer reported that Phelps was clocked going 84 mph in a 45-mph zone.
His trial is scheduled for Nov. 19.
The statement of probable cause said Phelps' eyes were red, bloodshot, and "his speech was mush mouth." When asked to do a one-leg stand, Phelps replied, "That's not happening," according to the statement.
Phelps was previously charged with drunken driving as a 19-year-old, fresh off his second Olympic games in Greece, where he won six gold medals. He pleaded guilty to the charges, but as a young first-time offender he was able to avoid conviction. He was granted probation before judgment and sentenced to 18 months on probation and a fine.
If convicted of the latest charges, Phelps faces up to a year in jail, a $1,000 fine and the loss of his driver's license for six months. However, legal experts said it's unlikely the swimmer would have to serve any jail time.
Follow Paul Newberry on Twitter at www.twitter.com/pnewberry1963