Canada's secret eavesdropping agency blasted the disclosure of one of its methods after it was reported the agency had tracked airline passengers.
A secret document leaked by former National Security Agency analyst Edward Snowden showed the spy agency used information gleaned from a free internet service at a Canadian airport to track the wireless devices of thousands of airline passengers.
The report indicated Communications Security Establishment Canada was given information taken from wireless devices using the airport's Wi-fi system over a two-week period. It was not clear which airport it was.
The document showed the spy agency was then able to track travellers for a week or more as they showed up at other Wi-fi locations in cities across Canada.
Communications Security Establishment Canada said: "The unauthorised disclosure of tradecraft puts our techniques at risk of being less effective when addressing threats to Canada and Canadians."
Under Canadian law, the CSEC is prohibited from domestic spying.
The agency said it was authorised to collect and analyse metadata, the identifying data generated by calls from wireless devices, such as telephone numbers and user location.
The Canadian Broadcast Corporation put the document on its website on Friday.
The report, dated May 2012, is a 27-page PowerPoint presentation describing the spy agency's airport tracking operation.
The document indicates the operation was a trial run of a new software program the spy agency was developing with help from its US counterpart, the NSA.
According to the documents, older software took too long to locate targets to be useful. The new software cut the time from more than two hours to several seconds in tests.
"It is important to note that no Canadian or foreign travellers were tracked. No Canadian communications were, or are, targeted, collected or used," CSEC said.
Defence Minister Rob Nicholson said in parliament that CSEC was in "complete compliance with Canadian law".
Ontario Privacy Commissioner Ann Cavoukian told the CBC that it was "unbelievable" the spy agency would engage in such surveillance of Canadians.
Agence France-Presse, Associated Press