During opening statements, prosecutor Sarah Mickelson said Trujillo had a history of being angry and aggressive in her contentious on-again, off-again relationship with Andersson, a native of Sweden who became a U.S. citizen.
Mickelson said that earlier in June, Andersson and Trujillo, 45, a native of Mexico, had reconciled.
The prosecutor described Andersson as mild-mannered and quiet, and Trujillo as hot-tempered.
On the night of the slaying, the couple was out drinking before they returned to Andersson's apartment. Mickelson said Trujillo got angry after arriving home and that the two began arguing.
Mickelson told jurors that during the confrontation, Andersson was injured and fell on his back. Trujillo sat on Andersson, preventing him from getting up, and repeatedly struck him in the face and head with her shoe, she said.
"The one thing we can be sure of in this case is that Ana Trujillo is not a victim. Ana Trujillo struck Stefan Andersson 25 times with the heel of her shoe while he lay on the floor and bled out," Mickelson said.
Trujillo's attorney, John Carroll, described Andersson as an alcoholic who would become violent toward Trujillo. He said on the night of Andersson's death, Trujillo planned to leave him and go to a friend's house, but Andersson slammed her against a wall, grabbed her and threw her over a couch.
"She couldn't breathe. And she was begging and begging (Andersson) to let her go ... He started suffocating her ... She did the only thing she could do, take a weapon at her disposal, which was a shoe, and started hitting him," Carroll said.
The first few witnesses for prosecutors described Andersson as a kind, polite man who did have a drinking problem.
The trial was expected to last at least a week.
Follow Juan A. Lozano on Twitter at https://twitter.com/juanlozano70