Taking the stand in his own defence, a New Brunswick high school teacher denied any sexual contact with a former student, in testimony that conflicts with what the court heard earlier this week.

William MacGillivray, a teacher and drama instructor at Moncton’s Harrison Trimble High School, is on trial for sexual exploitation, child luring, and obstruction of a police investigation.

He spent most of Thursday morning on the witness stand, testifying that the alleged victim, then 17, appeared at his house in a suicidal state in April 2013.

MacGillivray told the jury the student sent him unsolicited pictures of her body, showing evidence of self-harm.

He said they only talked, and never had sexual contact.

The alleged victim, however, told the court earlier this week she had visited about six times, three of which involved sexual contact.

The Crown challenged MacGillivray on several issues, including why he didn’t contact her parents or authorities when he learned of her mental state.

When asked why he deleted text messages sent between the two, MacGillivray replied he often would clear out his inbox.

The student was “troubled, obsessed and infatuated”, MacGillivray’s defence lawyer said in closing submissions.

The defence also questioned why the alleged victim was unable to describe details of the MacGillivray’s home or describe his body.

The Crown argued the young woman had done a good overall job in the description, and was not asked specifics in some cases.

The defence told the jury that the only thing MacGillivray was guilty of was showing compassion for a troubled student.

On Friday the judge is expected to instruct the jury on what evidence can be considered in reaching a verdict.

With files from CTV Atlantic’s David Bell