A former real estate agent from East Hampton who injured a town police officer in a drunken-driving crash over Labor Day weekend pleaded guilty to several charges in Suffolk County Criminal Court on Monday and as a consequence will avoid jail time.Andrew D. Hellman, 37, admitted to second-degree assault, a felony, for injuring the officer, as well as second-degree reckless endangerment and driving while intoxicated, misdemeanors. Other charges, including drug possession with intent to sell, were covered by the plea. He will remain free provided he successfully completes an inpatient drug rehabilitation treatment program. On Sept. 1 at about 4:45 a.m., in the parking lot of the Montauk 7-Eleven, Officer Andrew Nimmo was questioning Mr. Hellman, who was in the driver’s seat of a 2001 GMC, when Mr. Hellman suddenly sped off, dragging the officer some 15 to 20 feet before losing control of the S.U.V. It crashed about 10 yards away, across from the Kirk Park Beach parking lot, and rolled onto its side. Neither the driver nor his four passengers were hurt. Officer Nimmo was treated at Stony Brook Southampton Hospital and released later that day. When police searched the GMC, they found 20 plastic bags of cocaine, an aggregate weight of one-eighth ounce or more, inside — enough to justify a charge of drug possession with intent to sell. Mr. Hellman had prescription drug pills on him as well, police said. He has been in the county jail since his arrest, in lieu of $250,000 cash bail or $500,000 bond.He was to have been released yesterday into the custody of the County Probation Department, following the guilty plea in Justice Stephen L. Braslow’s courtroom. Officers will take him to Samaritan Daytop Village, a residential treatment facility in Queens, where he will spend a minimum of six months in the inpatient program under supervised release. His attorney, Peter H. Mayer of the Hauppauge firm Reynolds, Caronia, Gianelli & La Pinta, said his stay could be longer depending on the clinical assessment.The probation department will monitor Mr. Hellman in the program. Upon its successful completion, and provided he complies with any other conditions imposed upon him by the department, he will be formally sentenced, and the felony plea will be voided. He will then be sentenced only for the misdemeanors, Mr. Mayer said, describing what is known in the legal profession as a “downward departure.” “The felony will go away, and he will be convicted of a misdemeanor.”Should Mr. Hellman violate any of the conditions of his supervised release — anything from being late for curfew, to relapsing or leaving the program — he could be sentenced on the felony, to as many as five years in prison. “That’s the hammer hanging over him,” said Mr. Mayer, who is a recently retired Suffolk Supreme Court Justice. “This is a tool that is used in the criminal justice system,” the lawyer explained. The negotiated plea deal required the consent of the County District Attorney’s office, he noted, and the deal took seven months to reach. The two sides had to agree to “what the problems were that led to the offense and the just solution to the problem,” he said. “Quite frankly when you’re in jail, you’re detoxing, and that’s part of it.”Mr. Hellman will receive credit for time served — more than 220 days in jail over the last seven months — once he successfully completes the program and is sentenced to a misdemeanor. Misdemeanor offenses are punishable by up to a year in jail or three years of probation, or a combination of both. Under the law, when defendants serve up to eight months, they receive credit for one year. Mr. Hellman is just shy of eight months behind bars.