Image copyright Toronto Star via Getty Images Image caption Vice journalist Ben Makuch heads into court

Vice News has said it will comply with a production order to turn over to Canadian authorities communications with a terror suspect.

The company originally refused to hand over the notes and launched a four-year legal battle to fight the order.

Police are seeking communications Vice journalist Ben Makuch had with a Somali-Canadian terror suspect in 2014.

The media company said the case called into question Canada's press freedom credentials.

In a final appeal in April, Vice argued that the production order was no longer valid because the suspect, Farah Shirdon, had been killed in an airstrike in 2015.

But an Ontario Superior Court judge dismissed their application on Thursday, arguing that the Royal Canadian Mounted Police (RCMP) had not received sufficient evidence from US authorities to confirm Mr Shirdon's death. It was the fourth time Vice had lost their case in court.

Mr Makuch had received the support of numerous press freedom organisations, including Reporters Without Borders, during the legal battle. On Thursday he said he was disappointed with the court's ruling but respected Vice's decision to comply with the order.

"Throughout this four-year saga, the RCMP has treated me as a criminal rather than as a journalist," he said in a statement on Twitter. "This unfair treatment at their hands has been deeply troubling for me personally, and should be for all journalists in Canada."

The Canadian Association of Journalists said in a tweet on Thursday they were "proud" to have supported Mr Makuch and were disappointed with the court decision.

What is the background?

Mr Makuch, a national security journalist with Vice News, made contact with Mr Shirdon in 2014. The terror suspect was believed to have left his home in the city of Calgary in March of that year to join the Islamic State group - one of many young westerners who travelled to Iraq and Syria to join IS.

Vice eventually published three articles about Mr Makuch's conversations with Mr Shirdon, prompting the RCMP to seek access to all communications Vice had with Mr Shirdon as part of a criminal investigation into the suspect. Mr Shirdon was charged in absentia with six terrorism offences.

Vice went to court to appeal against the production order, arguing that handing over the text could have a "chilling effect" on communication with sources.

In November 2018, Canada's Supreme Court ruled that Vice must hand over its communications, ruling the production order "was properly issued and should be upheld".

Two lower courts had already upheld the order.