Matthew de Grood, who is 23, is accused of stabbing five young people at an end-of-school house party last April.
Several media outlets had requested access to search warrants and to witness interviews done immediately after the attack. The move was opposed by family members, the Calgary Police Service and the Crown.
Judge Tim Hironaka agreed to unseal the documents, but placed a ban on the evidence being made public until de Grood's trial is over.
"The issue at stake in this application is not if the sealed materials will be available for public scrutiny but only when," said Hironaka.
"I am satisfied that ... there is some material within each of the categories where publication could realistically put the fairness of the trial process in jeopardy."
De Grood was committed to stand trial earlier this month on five counts of first-degree murder.
He is charged in the deaths of Zackariah Rathwell, 21; Lawrence Hong, 27; Joshua Hunter, 23; Jordan Segura, 22; and Kaiti Perras, 23.
Several of their relatives attended court throughout the arguments over the evidence.
"I spent some time with the family afterward and they were pleased with the decision," said Crown prosecutor Neil Wiberg.
"They were concerned that this would get in the public realm and affect trial fairness both for the Crown and the defence."
Wiberg said he opposed the public release of the information, especially with a jury trial expected to likely go ahead next year.
"This way the material won't be published and affect potential jury members. If this became public, it would be difficult to have a fair concept of the evidence. A lot of people would have preconceived ideas."
Wiberg said much of the evidence in the warrant was obtained early in the investigation and may not even be admissible at trial.
Matt Woodley, the lawyer representing the media groups, was disappointed with the outcome.
"We had argued that jurors are able, in the vast majority of cases, to put evidence that they ought not consider out of their minds and render a verdict totally based on the evidence heard at the trial," he said.
A trial date for de Grood is to be set in May.
Follow @BillGraveland on Twitter
Also on HuffPost