TORONTO -- A man accused of sexually assaulting and killing a young woman told an undercover Toronto police officer the woman was alive when he left her in a stairwell following a sexual encounter, court heard Wednesday.

The officer, whose name is not being disclosed in court, said Kalen Schlatter confided in him and another undercover officer after his arrest in February 2018, while all three were in holding cells at a police station.

He said Schlatter described meeting Tess Richey at a club in the city's gay village the night she died, kissing and dancing with her in the venue.

Schlatter said he later ran into Richey and a friend of hers outside and walked with them a bit, the officer testified. After the friend left, Schlatter said he took Richey to a secluded alley to "hook up," according to the officer.

The officer said Schlatter described "making out and grinding" with Richey and eventually ejaculating in his pants. Richey, who was drunk and falling over, did not want to have sex because she was on her period, court heard.

"He was upset because he wanted to have sex with her," the officer, who sat behind a screen to protect his identity, told the court.

"He said that when they stopped kissing, that she just wanted to stay at the bottom of the stairs but that he wanted to leave," the officer said.

"Mr. Schlatter said that when he left her, she was alive, so maybe she took her own life, but he doesn't know."

Schlatter added that he was drunk so "something could have happened" but he didn't remember and didn't think he was "capable of doing it," the officer said.

Prosecutors, meanwhile, allege Schlatter sexually assaulted Richey in November 2017, then strangled her after she refused his advances.

Richey's body was found in a stairwell days after she went missing, discovered by her mother and a family friend.

The Crown said in its opening statement last week that Schlatter's DNA was found on Richey's pants and bra.

Prosecutor Bev Richards also said security footage from the club, which is expected to be presented in court, will show Richey and Schlatter were there but did not interact.

Richards said more footage will show Schlatter and Richey walking towards the stairwell in the alley together in the early hours of the morning, then Schlatter leaving alone 45 minutes later.

Schlatter was arrested months after Richey's death and police planned to place undercover officers in the holding cells at the same time in an effort to obtain any information relevant to the case, court heard Wednesday.

The undercover officer who took the stand was the first to be brought into a cell, then Schlatter was led to an adjacent one. A second undercover officer was later placed in the cell on the other side of Schlatter's, court heard.

The three initially talked about sports but it was when the officer brought up the card game Magic: The Gathering that Schlatter opened up, the officer testified.

He said Schlatter, who was 20 at the time, was excited to talk about the game and eventually the conversation turned to women. According to the officer, Schlatter bragged about having slept with more than 40 women and offered to share his "secrets" with the officers.

Schlatter laid out several strategies for picking up women, which included hanging out with gay men and going to gay bars because both attract straight women, the officer said.

He said Schlatter advised that "sometimes you have to push the boundaries with women, see where it goes."

Schlatter also discussed being questioned by police and said he told detectives he wished to remain silent, the officer said.

Schlatter told them detectives showed him pictures of Richey's body and he pretended to get emotional but didn't actually feel anything, the officer testified.

This report by The Canadian Press was first published Feb. 5, 2020.