Dwight Gooden, the former standout pitcher for the Mets and Yankees, was arrested last month in New Jersey and charged with cocaine possession and driving under the influence.

The police in Holmdel, a township in Monmouth County, said they pulled Gooden over just before 1 a.m. on June 7. According to Christopher Swendeman, a spokesman for the Monmouth County prosecutor’s office, Gooden was stopped for failure to maintain a lane, driving too slowly and overly tinted windows. According to the criminal complaint, the police found Gooden with two zip-lock baggies “containing suspected cocaine.”

Gooden, 54, faces up to five years in prison on the charge of possession of a controlled dangerous substance, a third-degree felony in New Jersey. He was also charged with possession of drug paraphernalia and being under the influence, as well as driving while intoxicated, which is considered a traffic violation in New Jersey.

Gooden’s arrest was first reported by The New York Post.

Known by the nickname “Doc,” Gooden was electric as a starting pitcher. He had a fastball that approached 100 miles per hour and a devastating curveball, and he dominated immediately for the Mets. As a 19-year-old rookie in 1984, he was named an All-Star, and his 1985 season is considered one of the best in baseball history. Gooden went 24-4 with a 1.53 E.R.A., averaging almost a strikeout an inning, on his way to winning the National League Cy Young Award.