Open this photo in gallery:

From left, Toronto Police Chief Myron Demkiw joins York Regional Police Chief Jim MacSween and Deputy Chief Ryan Hogan to announce the results of Project South in Aurora, Ont., on Feb. 5.Jon Blacker/The Canadian Press

Transcripts of key recordings that led to the Project South takedown will remain under a publication ban, after an Ontario Superior Court judge ruled Wednesday that inflammatory comments attributed to a Toronto police officer charged in the corruption case would “deeply offend” the public and create an indelible impression on potential jurors.

The ruling is in response to an application by The Globe and Mail and other media outlets to make public more than 500 pages of court documents and warrant applications that were unsealed earlier this year. Those files included what are known as information to obtain documents, which investigators use to get judicial authorization to conduct searches and make arrests.

While much of the content of those documents was released in July, portions were placed under a publication ban as the Crown and media outlets argued over whether their release should be shielded to protect fair trial rights.

In a ruling on Wednesday, Justice Laura Bird maintained a publication ban on some of that material, including a verbatim transcript of conversations alleged to have taken place between Toronto Police Constable Timothy Barnhardt and an alleged organized-crime figure, Brian Da Costa.

The pair were unaware at the time that they were central targets in a large-scale police corruption probe by York Regional Police, and that investigators were listening in on their calls.

“During their conversation, Mr. Barnhardt said things that would rightly deeply offend members of the public,” Justice Bird wrote of the alleged back-and-forth. “The comments attributable to him are made worse because he was sworn to uphold the safety of the public but demonstrated a complete indifference to extreme violence.”

While she stressed in her ruling that “the importance of public scrutiny in this case cannot be overstated,” she agreed with the Crown that these particular statements by the constable should not be made public. She said “they could create an indelible impression of guilt in the mind of potential jurors that would be extremely difficult to dispel.”

Project South was sparked by the alleged attempted murder of a corrections officer at his home. The warrants were issued early this year, before February raids that led to charges against seven serving Toronto Police officers, one retired officer and nearly 20 civilians.

Investigators have alleged that Constable Barnhardt used police databases to leak information about the target of the attack to Mr. Da Costa.

Database breaches were at the core of the allegations laid out in the project, which was one of the largest police corruption busts in Canadian history.

The information to obtain documents contain unproven allegations that have not been tested in court. ITOs don’t necessarily result in criminal charges and several of the people named in the documents do not face charges.

As The Globe reported in July, the documents reveal that police suspected the attempted hit may have been ordered by Gurpreet Singh, a jailed accomplice of alleged cocaine kingpin Ryan Wedding, with help from his former girlfriend, Nishwant (Nishy) Dosanjh, who was a guard at Toronto South Detention Centre. While neither Mr. Singh nor Ms. Dosanjh were charged, both were central targets in the murder-conspiracy investigation, the documents say.

Ms. Dosanjh’s lawyer, Miranda Brar, said in a statement that her client has co-operated fully with a months-long police investigation.

“She has not been charged with any criminal offence or professional misconduct,” Ms. Brar said. “She maintains her innocence.”

Mr. Singh’s lawyer, Brian Greenspan, has previously declined to respond to the allegations, noting that they have not led to a criminal charge.

In her ruling, Justice Bird said that the fact the York Regional Police only “stumbled upon” the alleged corruption in the course of their investigation is perhaps the “most concerning” piece of the allegations.

“They conducted a search to determine who may have recently queried the victim’s address and learned that Mr. Barnhardt had. There is no evidence that anyone was suspicious of Mr. Barnhardt or his associates until that moment,” she wrote.

“That is something that should be of tremendous concern to the public because it demonstrates that a trusted public official can engage in widespread illegal conduct and go undetected.”

Stephanie Sayer, a spokesperson for Toronto Police, said she could not comment on Justice Bird’s ruling or alleged acts of police misconduct.

The force plans to update the public about anti-corruption initiatives launched in the wake of Project South during November’s civilian-oversight police board meeting.

“TPS has taken a number of steps to strengthen oversight, accountability and professional standards,” Ms. Sayer said.

Toronto lawyers Jason Dos Santos, who represents Constable Barnhardt, and Craig Bottomley, who represents Mr. Da Costa, declined to comment on Wednesday.

The two are jointly charged with giving and accepting bribes, unauthorized use of computers, and conspiring to obstruct justice, among other allegations.

Mr. Da Costa, 44, faces charges including bribing a peace officer, unauthorized use of police computers, trafficking police uniforms, conspiring to obstruct justice, and cannabis possession and exportation. He was released on bail of $1.5-million in March, only to have it revoked after a bail review in May.

Constable Barnhardt, 56, is the only officer in custody, having twice been denied bail. His charges include accepting bribes, unauthorized use of police computers, trafficking police uniforms, conspiring to obstruct justice, and cocaine trafficking.

In addition to Constable Barnhardt, six other TPS officers – Sergeant Robert Black, Sgt. Carl Grellette, Constable Saurabjit Bedi, Constable Elias Mouawad, Constable Derek McCormick and Constable John Madeley Jr. – were charged on an array of allegations that include bribery and drug trafficking. One retired constable, John Madeley Sr., was also charged.

In late July, Mr. McCormick, who retired from the police service this summer after his arrest, pleaded guilty to breach of trust and one count of theft under $5,000. The 57-year-old received a 10-month conditional sentence after admitting to stealing cellphones that had been turned in by members of the public while he was working a front desk at downtown’s 52 Division. Court heard that he was struggling with an addiction to painkillers at the time.

The allegations against the other officers have not been tested in court.

In response to the Project South corruption case, the province’s Inspector-General of Policing launched a sweeping Ontario-wide review of police services. Estimated to take a year and a half, the review will look at police-officer screening, supervision and substance abuse. It will also look at evidence management and how to safeguard law-enforcement databases.