SALT LAKE CITY — A woman drew her ex-husband outside his apartment with a message about dropping off cold medicine for their 3-year-old twins, then sneaked inside and fatally shot his girlfriend while she and the children were decorating a Christmas tree, a Utah prosecutor said Wednesday.

Chelsea Watrous Cook is charged with aggravated murder, burglary and violence in the presence of a child in the killing of Lisa Vilate Williams. No attorney was immediately listed in court records for Cook, who was a high school heath teacher in Lehi, Utah, before her arrest on Nov. 25.

Cook, 32, refused to leave when her ex-husband, Travis Cook, returned from the parking lot, authorities said. She locked herself in the bathroom as he called 911.

Less than a minute later, she walked out, grabbed a gun from her coat and fired the fatal shots. Her ex-husband told the children to run into their rooms and lock the doors. He pinned his ex-wife to the wall and waited for police to arrive.

Williams’ family has said Cook harassed the 26-year-old woman for months online, on the phone and in person before the shooting. A police report indicates Williams had come up during a previous fight between the onetime couple the month before she was killed.

The report detailing misdemeanor domestic violence charges filed against Cook was obtained by the Associated Press under a public records request.

It said the couple had a history of difficult custody exchanges, and on Oct. 16 Cook yelled “disparaging comments” about Williams during an unrelated fight as her ex-husband tried to pick up the children.

When he prompted one of the children to say they were excited about seeing her, Cook got angry and grabbed the man by the hair, sending him tumbling down the stairs, police said. Williams was not present at the time.

Her lawyer in that case has not returned calls seeking comment, but Cook had pleaded not guilty.