Superstar golfer Tiger Woods pleaded guilty to reckless driving and agreed to enter a diversion program Friday, five months after he was found passed out in his Mercedes with prescription drugs and marijuana in his system.

Woods, 41, spoke only briefly during a hearing at a Palm Beach County, Fla., courthouse, answering questions from a judge about his plea agreement. Prosecutors dropped his driving under the influence charge, and the judge warned him to stay out of trouble.

"This particular plea agreement has no jail time on it. However, if you violate your probation in any significant way, I could revoke your probation and then I could sentence you to jail for 90 days with a fine of up to $500 [US], is that understood?" Judge Sandra Bosso-Pardo said.

Woods, 41, nodded. He did not make any statement during the hearing or outside the courthouse.

In the diversion program, Woods will spend a year on probation and pay a $250 fine and court costs. He has already met some of the program's other requirements, completing 50 hours of community service at the Tiger Woods Foundation, Palm Beach County State Attorney Dave Aronberg said.

Aronberg didn't say specifically what Woods did with the charitable group, but said he met the terms of the deal. Woods also attended a workshop where victims of impaired drivers detail how their lives were damaged.

Program for 1st-time offenders

Aronberg said most DUI offenders do not qualify for the diversion program because they have a prior record or were in an accident. About 2,500 first-time offenders have graduated from the county program since it began four years ago.

"This is designed for first-time offenders, where the person made a one-time mistake and they're going to overcome it," Aronberg said. "Mr. Woods was treated like any other defendant in his situation."

Since he was intoxicated with prescription drugs and marijuana, according to court records, he will also be required to undergo regular drug tests. Woods is also not allowed to drink alcohol.

Woods arrived at the courthouse in a black sport utility vehicle, wearing sunglasses and a dark suit with no tie. Police officers surrounded him as he walked down a hallway inside the courthouse and they ringed the inside of the courtroom during the high-profile proceeding.

Woods was arrested about 2 a.m. ON May 29 when officers found him unconscious in his Mercedes, which was parked awkwardly on the roadside and had damage to the driver's side.

It's not clear how he damaged the car. Officers checked the area but didn't find that he had hit anything. He was about 15 miles from his home.

Arrest recorded on officer's dashcam

His arrest was recorded by an officer's dashcam video and released to the public.

Woods had the active ingredient for marijuana, two painkillers — Vicodin and Dilaudid — the sleep drug Ambien and the anti-anxiety drug Xanax in his system but no alcohol, according to a toxicology report released in August. He completed a drug treatment program in July.

Woods has said he had been self-medicating to relieve the pain from his fourth back surgery and insomnia.

The DUI arrest was the first time Woods had been in trouble since American Thanksgiving weekend 2009, when he plowed his SUV into a tree and a fire hydrant outside his then-Windermere, Fla., home. That led to revelations that he had multiple extramarital affairs and a divorce from his wife Elin Nordegren, the mother of his two children. He spent 45 days in a Mississippi clinic where he was treated for an addiction.

Woods' 79 PGA Tour victories and 14 major titles both rank No. 2 all-time. He has not competed since February because of his back injury and is not expected to return this year. His last win was in August 2013. Woods has said his back is improving. Even though he has been a non-factor on the PGA Tour, Forbes Magazine lists Woods as the 17th best-paid athlete in the world in 2017, making $37 million, almost exclusively from endorsements.