A twisted Northwestern University professor accused of murdering his boyfriend in 2017 pulled a knife on a man he met on Grindr a year earlier while asking if he could pretend to stab him as they had sex, according to court testimony.

Jeremy Zaloun, testifying Thursday before a Cook County judge in the first-degree murder trial of former professor Wyndham Lathem, said he denied the frightening request by the renowned microbiologist and told him he wanted to leave, the Chicago Tribune reported.

"He told me I would leave when he said I could," the 46-year-old military vet told jurors. "I watched him basically turn from Fred Flintstone to Freddy Krueger in about 30 seconds."

In this Aug. 19, 2017, file photo, Wyndham Lathem arrives at a police station as he is escorted by Chicago police in Chicago.

In this Aug. 19, 2017, file photo, Wyndham Lathem arrives at a police station as he is escorted by Chicago police in Chicago. (AP Photo/Jim Young)

EX-NORTHWESTERN PROFESSOR TO STAND TRIAL IN ‘SEXUAL FANTASY’ STABBING DEATH

The January 2016 encounter occurred in Lathem’s high-rise condo, Zaloun testified, and ended only when he pulled his gun on the professor and ran out.

Zaloun later reported the incident in August 2017 as Lathem, 47, was named as a suspect in the stabbing death of his boyfriend, Trenton Cornell-Duranleau, 26, whose body was found stabbed more than 70 times in Lathem’s condo on July 27, 2017, the Chicago Sun-Times reported.

Prosecutors allege Lathem killed the young hairstylist from Michigan after entering a death pact with an Oxford University financial officer, Andrew Warren, who flew to Chicago from England days earlier.

Once together in Chicago, Warren, had planned to shoot Lathem, who in turn, would stab the British man, prosecutors said. But Warren, 61, who pleaded guilty to Cornell-Duranleau’s murder in 2019, testified Wednesday that the professor opted to kill his boyfriend instead, the Tribune reported.

FLASHBACK: FROM RESPECTED AT ELITE UNIVERSITIES TO WANTED FOR MURDER

Warren was set to go on trial in the gruesome slaying before agreeing to testify against Lathem in exchange for a 45-year prison sentence. Prosecutors had previously said the pair chatted online for months and plotted to kill Cornell-Duranleau before taking their own lives.

Lathem lost his Northwestern job after fleeing Chicago following the slaying, while Warren was suspended from his post as a financial officer at Somerville College, which is part of the University of Oxford system.

The pair later turned themselves into authorities in California amid a nationwide manhunt that lasted eight days.

Attorneys for Lathem, meanwhile, insist Warren acted alone and stabbed Cornell-Duranleau in a jealous rage after catfishing the professor during their online romance.

WASHINGTON UNIVERSITY CREATES SEGREGATED HOUSING SPECIFICALLY FOR BLACK STUDENTS

"[For] Andrew Warren, this was nothing more than a crime of opportunity that had two victims," defense attorney Kenneth Wine said Monday on the first day of Lathem’s trial.

Lathem is expected to testify next week, the Tribune reported. His attorneys acknowledged during opening statements that he liked to engage in "knife play" during sex, according to the Sun-Times.

Jurors also heard Thursday how Lathem was dejected after not getting a position at the Pasteur Institute — an internationally renowned center for biomedical research in Paris — after failing a background check.

Days after his boyfriend’s slaying, Dr. Andrea Hall, who oversees lab safety at Northwestern University, testified she received an email purportedly from Lathem promising he hadn’t done anything improper with the samples of bacterium he was studying.

CLICK HERE TO GET THE FOX NEWS APP

"I have put you in a terrible spot," the email read, according to the Tribune. "I am so sorry for everything that has happened and what is to come."

Prosecutors have said Lathem was so disheartened by the losing the job in Paris that it led to suicidal impulses and the alleged death pact with Warren. But Hall testified he appeared to recover and was well-respected at Northwestern, the Sun-Times reported.