A Vice Media reporter will have to hand over records of his conversations with an alleged ISIS member to police following a Supreme Court of Canada decision.

In the unanimous decision released Friday, the top court upheld a lower court's ruling regarding the work of reporter Ben Makuch.

The case was seen as pitting journalists' interest in protecting their sources against the state's duty to investigate crimes. In a statement issued after the ruling was released, Vice called it "a dark day for press freedom, which is a basic tenet of democracy."

"While we've lost this battle, nothing can shake our belief that a free press is instrumental to a truthful understanding of the world in which we live. We will continue to foster the power of youth voices to speak that truth," the statement said.

Makuch took to Twitter to say he's "profoundly disappointed in today's ruling."

STATEMENT: I am profoundly disappointed in today’s ruling, not just as an appellant in this case or a reporter, but as a citizen of Canada. It is truly a dark day for press freedom around the globe at a time where journalism is unquestionably under attack everywhere. —@BMakuch

The case dates back to 2014, when Makuch wrote three stories about Farah Mohamed Shirdon, a former Calgary resident, and his ties to the Islamic State in Iraq and Syria.

Intrigued by the idea of a young man leaving a Canadian city to fight for a terrorist group, Makuch embedded himself in Shirdon's online world and eventually convinced him to explain some of ISIS's online recruiting and radicalizing strategies.

In 2015, the RCMP filed an information to obtain order (ITO) compelling Vice and Makuch to produce all of his communications with Shirdon — who has since been killed, according to reports — including Kik Messenger chats, paper printouts, screen captures and any other computer records.

Minister of Official Languages Melanie Joly offers a general comment about the government's support of the protection of journalistic sources. 0:22

Kik does not store messages on servers, meaning police could not go to a service provider for copies of the conversation.

"The articles contained statements by the source that, if true, could provide strong evidence implicating him in multiple terrorism offences," says the court's decision, written by Justice Michael Moldaver.

Makuch brought an application forward to quash the RCMP's production order, but it was dismissed — a decision upheld by the Ontario Court of Appeal.

In their Friday decision, the Supreme Court justices said that while it was important for media to be able to gather news without government interference, that right was outweighed in this case by society's interest in investigating and prosecuting crimes.

A previous court decision set out a framework of nine conditions for deciding when police should be able to access media materials. Vice Media argued before the Supreme Court that the lower courts had incorrectly applied those conditions.

Moldaver wrote that the production order for Makuch's records should proceed because his work didn't involve "off the record" or "not for attribution" conversations, meaning the records would not reveal the identity of a confidential source.

He also wrote that screen shots of the conversations were the only way for police to obtain hard copies of what was said.

Media not 'an arm of the state'

However, the Supreme Court justices said Friday that framework guiding access to media materials should be refined.

Right now, police can go before a court to make the case for a production order ex parte — without the journalist or media outlet present. In today's decision, the justices said journalists should be given the chance to argue their side — unless it's an emergency.

"The authorizing judge may find it desirable to require that notice be given to the media," notes the decision.

"However, that conclusion is not mandatory."

CWA Canada, a union representing thousands of journalists, called it a troubling ruling.

"Police have an important job to do in protecting us from crime, but they cannot expect journalists to do that job for them. The media is not, nor should it ever be, an arm of the state," said president Martin O'Hanlon.

It's not clear what happens next with the investigation.

NDP MP Alexandre Boulerice calls for stronger legislation to protect journalists. 0:39

A spokesperson for Public Safety Minister Ralph Goodale said his department is reviewing the court's decision.

In a statement, the RCMP said it "respects judicial process and the ruling determined by the Supreme Court of Canada and will not comment further."

The court did not deal with the Journalistic Sources Protection Act — Conservative Senator Claude Carignan's bill passed in late 2017 — because the facts behind the Vice case transpired before the law took effect.

That law aims to protect confidential sources from investigations by the police.

Minister of Tourism, Official Languages and La Francophonie Mélanie Joly said the government believes "in the importance of protecting sources and making sure that journalists can protect their sources."

"We've supported the Senate bill that was presented by Senator Carignan because we believe in having a strong free and independent press, and therefore we will continue to abide by these principles," said Joly, who previously held the Heritage portfolio.

"As to the particular facts of this case, obviously I don't have any comments as of now because I haven't had the chance to read it."