DOVER, N.H. – A University of New Hampshire student who prosecutors say was raped and killed after she rebuffed a man’s sexual advances went to his home thinking she was going to watch a movie or play a videogame, his ex-girlfriend testified Tuesday.

In reality, Seth Mazzaglia had demanded that the girlfriend, Kathryn McDonough, find him a sex partner as punishment for leaving him alone for 12 days, McDonough told jurors.

The acquaintance, 19-year-old Elizabeth “Lizzi” Marriott of Westborough, Massachusetts, was killed inside the couple’s Dover apartment when Mazzaglia “strangled her with a rope,” McDonough testified. When asked how she knew who the killer was, she replied, “I was there.”

McDonough, 20, is the key witness against the 31-year-old Mazzaglia at his first-degree murder trial, which began last week. The case is plumbing the sexual relationship between McDonough and Mazzaglia, including their obsession with bondage, discipline and sadomasochism and their practice of inviting others to join them.

McDonough is serving a prison sentence for lying to investigators about Marriott’s disappearance and death.

She testified for hours Tuesday about her sadomasochistic relationship with Mazzaglia and the lead-up to Marriott’s killing. She didn’t give a detailed account of the killing but she was expected to return to the witness stand Wednesday.

Mazzaglia’s lawyers have told jurors that McDonough killed Marriott during rough sex involving restraints. They say Mazzaglia helped dispose of her body and initially took the blame to protect McDonough. They say McDonough was the dominatrix, a woman who made Mazzaglia her sexual slave and obsessed with finding another woman to dominate.

McDonough testified she was always the submissive or slave in their relationship and was never in the dominant role. She also described a punishing rape.

McDonough told jurors she was charged with finding Mazzaglia a submissive, sexual partner for the 12 days in August 2012 when she would be a counselor at a theater camp in Maine. She put up ads on fetish websites and thought she had secured a partner for her then-boyfriend, but the woman changed her mind while McDonough was at camp.

Mazzaglia sent her an angry text message about how he planned to punish, tie up and rape her repeatedly when she returned home.

He made good on the threat, she said.

“It was a very rough encounter,” she said. “There was a lot of hitting, twisting, smacking. It’s not something I wanted to do, but I knew I didn’t have an option because I had messed up.”

His threatening text included a second punishment:

“The second price is this,” he wrote. “You choose a friend – any of yours will do – and you offer her to me.”

Marriott met McDonough at a department store where they both worked. On the night she died in October 2012, Marriott texted her girlfriend that she was going over to “Kat’s” to watch a movie. It was Marriott’s last communication.

McDonough is serving a 1½- to three-year sentence for conspiracy and hindering prosecution.

Defense attorney Joachim Barth told jurors during his opening statement that McDonough bargained her concocted story of what happened that night in exchange for time off her sentence, and that testifying against Mazzaglia is part of her plea deal.

Bob Marriott, the victim’s father, said at her sentencing last July that the family grudgingly accepted the plea deal to further Mazzaglia’s prosecution.

McDonough was 17 when she met Mazzaglia at tryouts for a theater production. She testified at length Tuesday about how he pressured her to move in with him while she was still in high school, which she did, and to cut ties with her mother.