Global Affairs Canada says Albertan Sarah McIver has been released from custody in China and returned to Canada.
McIver had been detained over a work-permit issue related to her teaching job.
Her arrest followed those of Michael Kovrig and Michael Spavor, two Canadians living and working in China, on allegations they were harming China's national security.
China arrested Kovrig and Spavor separately after Canadian authorities detained a Chinese technology executive in Vancouver.
Meng Wanzhou, the chief financial officer of electronics giant Huawei Technologies, is wanted in the United States on allegations she lied to American banks as part of an effort to get around sanctions on Iran.
Both China and Canada have insisted that McIver's case is different from Kovrig's and Spavor's.