Canada’s electronic spy agency collected data from thousands of travellers passing through a major airport and tracked their wireless devices for days after they left the terminal, according to a secret document leaked by whistleblower Edward Snowden.

The Communications Security Establishment Canada (CSEC) collected information gathered from unsuspecting passengers’ wireless devices by the airport’s free wi-fi system over a two-week period in 2012.

CSEC then tracked the travellers for a week or more as their wireless devices showed up in wi-fi “hot spots” in cities across Canada and even at US airports, the Canadian Broadcasting Corporation (CBC) quoted a top secret document retrieved by Snowden as saying.

The document indicated the passenger tracking operation was a trial run for a powerful new software programme being developed jointly with the US National Security Agency (NSA).