A Canadian news outlet must give the RCMP background materials used for stories on a suspected terrorist, despite objections from the reporter, a judge has ruled.

In addition, Ontario Superior Court Justice Ian MacDonnell banned publication of information police relied on to obtain a court order that Vice Media and reporter Ben Makuch produce the materials related to Farah Shirdon.

Three Vice stories in 2014 were largely based on conversations Makuch had with Shirdon via an online instant messaging app called Kik Messenger. RCMP want access to Makuch's screen captures of those chats.

"The screen captures are important evidence in relation to very serious allegations," MacDonnell said in his ruling. "There is a strong public interest in the effective investigation and prosecution of such allegations."

Makuch told CBC News that he does not want to comply with the ruling and said he will be "exhausting every legal option available."

Makuch's lawyer, Iain MacKinnon, said Vice is considering an appeal and Makuch would not need to hand the files over until a decision on that has been made.

Canadian judge orders <a href="https://twitter.com/vicenews">@vicenews</a> journalist to hand over digital messages: <a href="https://t.co/ppvZwFn1OF">https://t.co/ppvZwFn1OF</a> <a href="https://t.co/YRG4krqjIW">pic.twitter.com/YRG4krqjIW</a> —@vicecanada

In October 2014, Makuch cited Shirdon, of Calgary, as saying from Iraq: "Canadians at home shall face the brunt of the retaliation. If you are in this crusader alliance against Islam and Muslims, you shall see your streets filled with blood."

RCMP charged the Toronto-born Shirdon, 22, in absentia last September with several offences, including leaving Canada to participate in the activity of a terrorist group, taking part in the activity of a terrorist group, and threatening Canada and the U.S.

An RCMP spokesman said in an email that the police force respects the court decision.

Police said they needed the Makuch materials as proof Shirdon had been in Iraq. They also want to know how Makuch tracked the suspect down, but the reporter said he simply monitored his online activities.

'It's a scary thing,' says reporter

Makuch said this case is not just important for journalists, but for Canadians in general.

"If we're going to be made an investigative arm of the police, it's going to change how we newsgather," he told CBC News. "It's also going to change how sources interact with us."

He said it could affect sources in areas such as drug trafficking and hacking, and whistleblowers.

"Do whistleblowers want to come forward to a journalist if they know that any of their communications or any notes that the journalist makes about them could be forked over to the police? It's a scary thing."

MacKinnon reiterated concerns about the ruling's effect on the ability of journalists to do their jobs.

Farah Mohamed Shirdon is shown in an RCMP photo. The RCMP charged the Toronto-born Shirdon, 22, in absentia last September with several terrorism-related offences. (RCMP/Canadian Press)

"Police officers investigating crimes may start using similar production orders more often in the future and rely on journalists as an investigative arm or tool to gather evidence in their investigations."

MacDonnell, however, accepted government arguments that Vice was the only source of the needed information.

"The screen captures are a copy of the actual electronic messages that Shirdon placed on Mr. Makuch's computer screen," MacDonnell said. "They are highly reliable evidence that do not require a second-hand interpretation."

The justice also rejected Vice's argument that police essentially already had all the relevant information.

Makuch said he has published all information relevant to the public.

"There's no imminent national security threat based on information I have," he told CBC News. "I would never sit on something like that — and in fact, why would I? I'm a journalist — we make stories."

'Serious chilling effect'

MacKinnon said he was satisfied the judge who issued the initial production order last year had taken into account the special position of the media, and had properly balanced the interests of law enforcement and the media's right to freedom of expression.

MacKinnon, however, said the decision could have a "serious chilling effect" on journalists.

"Their credibility and independence will be undermined if people believe that anything they say to journalists could be easily turned over to police," the lawyer said.

Nick Taylor-Vaisey, president of the Canadian Association of Journalists, said in a statement the ruling "could set a dangerous precedent, and certainly threatens press freedom."

"Journalists should never be expected to act as an on-call branch of law enforcement," he said. "We report in the public interest, not in the interest of ongoing police investigations."

NDP Leader Tom Mulcair takes part in a Vice town hall meeting in Toronto during the federal election race in October. Started in 1994 as a Montreal punk magazine, Vice Media Canada Inc. has grown into a global multimedia brand with print, television and online content. (Ryan Remiorz/Canadian Press)

In banning publication of the supporting documentation police used to obtain the production order, MacDonnell said it was necessary to preserve Shirdon's right to a fair trial — should he ever be arrested and tried.

The case, he said, had attracted national attention in light of ISIS's "brutality and barbarism" and the prospect young Canadians were being radicalized and might become homegrown terrorists.

"I am satisfied that publication of portions of the information … concerning Farah Shirdon's alleged involvement with ISIS and of statements he is alleged to have made — some of which the public might find to be quite alarming — would pose a serious risk to his right to be tried by an impartial jury," the justice said.

MacDonnell's ruling was issued Tuesday, but was subject to a temporary ban to give the federal government a chance to see if any of his reasons needed redacting. That ban has now been lifted.