By Steve Gorman

LOS ANGELES (Reuters) - The wife of a small-town Southern California mayor shot dead during a domestic dispute in their home two years ago pleaded guilty on Wednesday to voluntary manslaughter in his slaying, the Los Angeles County District Attorney's Office said.

Under terms of the her plea deal with prosecutors, Lyvette Crespo, 45, is expected to be sentenced to 90 days in the county jail, five years of formal probation and 500 hours of community service, the D.A. said in a statement.

Her punishment is also to include an anger management course, prosecutors said. Sentencing is set for Jan. 5. If the judge decides to impose a harsher penalty, Crespo will have an opportunity to change her plea.

If convicted at trial, Crespo could face up to 21 years in prison.

She was accused of fatally shooting her husband, Daniel Crespo, 45, then mayor of the Los Angeles suburb of Bell Gardens, three times in the chest during a heated quarrel on Sept. 30, 2014, inside their condominium.

According to a police account of the incident, the couple's then 19-year-old son, Daniel Jr., intervened in the argument, leading to a physical confrontation between father and son, which prompted his mother to grab a pistol and open fire on her husband. He was pronounced dead at a nearby hospital.

The son told emergency dispatchers his mother had acted in self-defense, according to a recording of a 911 call made just after the shooting.

Lyvette Crespo's lawyer, Eber Bayona, has said his client, a stay-at-home mother, had been the victim of domestic violence at the hands of her husband for many years. And an attorney for the couple's two grown children said both the son and daughter stood behind their mother.

A biography of the mayor online at the time of his death said he was a native of the Brooklyn borough of New York City and described the couple as having been high school sweethearts who married in 1986.

Besides serving as mayor of Bell Gardens, a small municipality southeast of Los Angeles of about 45,000 residents, Daniel Crespo had worked as a county probation officer for more than 20 years.

(Reporting by Steve Gorman; Editing by Tom Hogue)