A San Francisco elementary school principal pleaded no contest Tuesday to drunk-driving charges that stemmed from a May 12 incident in which she sideswiped two cars near the Golden Gate Bridge, the district attorney’s office said.

Sheila Sammon Milosky, 50, the principal of Paul Revere Elementary School, was sentenced to 30 days in county jail, to be served through the sheriff’s work alternative program, and placed on three years probation, said Alex Bastian, a spokesman for the district attorney.

Prosecutors dropped the misdemeanor hit-and-run charge in exchange for the no contest pleas to driving under the influence and driving with a blood alcohol content of .08 or higher.

Bastian said in addition to the 30-day work program and probation, Milosky must undergo a nine-month alcohol counseling program and pay restitution that will be determined at a later date.

Milosky was driving a white 2011 Dodge Avenger with Colorado plates at about 12:15 a.m. on May 12 when she encountered bumper-to-bumper traffic getting onto the Golden Gate Bridge.

Witnesses said the Mill Valley resident disregarded the cars in front of her and inched her way up, hitting a Hyundai Tuscon and a black Lincoln limousine. Passengers in the limousine said she refused to stop, even after the driver and passengers got out and knocked on her window. They said she was like a “zombie” behind the wheel.

Milosky and her attorney both did not return calls for a comment.

San Francisco Unified School District spokeswoman Gentle Blythe previously said that though district officials are monitoring the situation, misdemeanor convictions are not grounds for termination.