BEIJING — China acknowledged on Thursday that the authorities there had detained a third Canadian citizen, a teacher from Alberta, making her the most recent casualty in a diplomatic standoff between the two countries.

The Foreign Ministry said that “a female Canadian citizen” identified as Sarah D. McIver had been working illegally and was being held in administrative detention. The Canadian government announced the detention on Wednesday but did not release Ms. McIver’s name.

Ms. McIver’s detention came days after the arrests of Michael Kovrig, a former Canadian diplomat who was working for a nongovernmental organization in China, and Michael Spavor, an entrepreneur specializing in business with North Korea.

The three detentions appear to be in retaliation for Canada’s arrest of Meng Wanzhou, the chief financial officer of Huawei, the giant Chinese technology company. Ms. Meng was detained on Dec. 1 while in transit in Vancouver, on her way from Hong Kong to Mexico.