She had always admitted to killing her husband, using two guns to fire 11 bullets inside the couple’s home in Queens. But she insisted she had no choice: if she had not shot him, he would have surely killed her first.

On Thursday, a jury in State Supreme Court in Queens agreed, clearing the woman, Barbara Sheehan, of second-degree murder charges in a case that had been viewed as a strenuous test of a battered-woman defense. Her son and daughter, the children of her slain husband, wept with joy.

During the trial, the jury heard how Ms. Sheehan had been relentlessly abused by her husband, Raymond Sheehan, a former police sergeant, during their 24 years of marriage. But the critical question at trial was whether Ms. Sheehan was in imminent danger when she killed her husband; New York State’s self-defense law justifies the use of lethal force when a threat to a person’s life is deemed immediate.

The trial offered two narratives so diametrically opposed that jurors said it had often been difficult to decipher who the real Barbara Sheehan was.