CHICAGO — Since the death last month of a man in a downtown luxury apartment here, details had trickled out, perplexing and graphic. Two employees of elite universities were accused of fatally stabbing the man and then fleeing across the country in an attempt to avoid capture.

But on Sunday, as the two university workers stood before an Illinois judge for the first time, prosecutors laid out a plot still darker and more gruesome. Before the killing, the two men — Wyndham Lathem, who had been a professor at Northwestern University, and Andrew Warren, an administrator at the University of Oxford in England — had talked for months in an internet chat room about their “sexual fantasies of killing others and then themselves,” prosecutors said.

The attack, the prosecutors indicated, was the culmination of those conversations, with Mr. Lathem paying to fly Mr. Warren to the United States and the two men carefully plotting the killing of Mr. Lathem’s boyfriend, Trenton Cornell-Duranleau.

Prosecutors said the men attacked Mr. Cornell-Duranleau, 26, as he slept, stabbing him 70 times. His throat was slit, according to prosecutors, his head nearly cut from his body. His final words, according to the authorities: “Wyndham, what are you doing?”