SAN DIEGO - A man accused of strangling a female co-worker, then stuffing her body into a suitcase at a downtown San Diego hotel where he lived, told a friend that he "crossed the line sexually" during an encounter in his room, the witness testified Wednesday.

Samantha Joyce, testifying at a preliminary hearing for 32-year-old Joshua Matthew Palmer, said he texted her on April 5, saying he went back to his hotel room with a woman named Chelsea the night before.

Joyce said Palmer told her that besides him and Chelsea, a co-worker named Shauna Haynes and another man, Anthony Kern, were also there.

Joyce testified that she had seen Palmer and Haynes together occasionally at the Gaslamp restaurant where she worked.

"They just seemed to be really good friends," Joyce said of Palmer and the 21-year-old Haynes.

A few hours after the early morning sexual encounter, Palmer called 911, saying his girlfriend was missing, a detective testified. When contacted, Palmer had red knuckles on both his hands, the detective testified.

Police got a search warrant and seized video files from Palmer's cell phone, showing an unconscious Haynes. On one of the videos, Palmer can be heard saying, "OMG. It just turned into a foursome."

In another clip, Palmer is heard to say, "I'm sorry I love you, but I can't watch you having sex with somebody else. God I'm sorry."

Deputy District Attorney Martin Doyle alleged that Palmer -- who worked with Haynes at the Spaghetti Factory restaurant -- stuffed Haynes' body into a suitcase and threw it out with the garbage.

The morning of April 6, a guest at the hotel in the 600 block of A Street found the suitcase containing the victim's body near a row of trash cans alongside a parking area at the rear of the three-story building.

Noticing what appeared to be hair protruding from a zipper on the case, the man made an emergency call. Patrol officers confirmed the death, then called in a homicide team. Palmer was arrested two days later.

At the conclusion of the preliminary hearing, which continues Thursday, Superior Court Judge Louis Hanoian will determine whether enough evidence was presented for Palmer to stand trial.

He is charged with murder, with special circumstance allegations of murder during a rape, murder during sodomy and murder during a rape by an instrument, which would potentially make him eligible for the death penalty.

District Attorney Bonnie Dumanis would decide whether Palmer would face capital punishment or life in prison without parole if he's convicted.