A Canadian citizen who was detained in China for two years over accusations of spying has been freed and has returned to Canada.

Prime Minister Justin Trudeau said Thursday he's delighted Kevin Garratt is back in Canada with his family. His return comes just over a week after Trudeau visited China in a bid to improve relations.

Garratt had been indicted by prosecutors in Dandong, a city on the North Korean border where he and his wife ran a popular coffee shop and conducted Christian aid work for North Koreans. He and his wife Julia were arrested in August 2014 by the state security bureau. His wife was later released on bail.

Trudeau says his government had made the case a priority at the highest levels.