A long-running case against a former San Francisco police crime lab technician ended in a misdemeanor plea bargain Friday when she pleaded guilty in federal court to a reduced charge of possessing cocaine in 2009.

A mistrial was declared for a second time in federal court Thursday in the case of a former San Francisco police crime laboratory technician accused of taking small amounts of cocaine from the facility in 2009.