Two Canadians detained in China on spying charges were released from prison and flown out of the country on Friday, Prime Minister Justin Trudeau said, just after a top executive of Chinese communications giant Huawei Technologies reached a deal with the US Justice Department over fraud charges and flew to China.