St. Mary Medical Center in Long Beach. File photo.

A judge declared a mistrial today in the case of a doctor who alleged she was wrongfully fired before the third year of her residency at a Long Beach hospital in 2014 for complaining about patient-safety issues and gender discrimination.

Los Angeles Superior Court Judge J. Stephen Czuleger declared the mistrial after jurors said they were hopelessly deadlocked at 8-4 in favor of defendants Dignity Health and St. Mary Medical Center after several days of deliberations in trial of the lawsuit brought in March 2015 by Dr. Noushin Khoiny.

During the trial, which lasted more than a month, Khoiny alleged she was treated different because she was a woman and that she was forced to work back-to-back long-call shifts that violated the Accreditation Council for Graduate Medical Education and jeopardized the safety of patients.

However, defense attorneys stated in their court papers that Khoiny was fired for having a “marginal performance.” They also stated that the residency program at St. Mary is 60 percent men and 40 percent female, consistent with the national average for residency programs of 58 percent men and 42 percent women.

Khoiny’s father and brother also are physicians.