An unprecedented cyberattack on the Canadian government, apparently from China, has given foreign hackers access to highly classified federal information and forced at least two key departments off the internet, CBC News has learned.

The attack, first detected in early January, left Canadian counter-espionage agents scrambling to determine how much sensitive government information may have been stolen and by whom.

Two federal government departments say there have been "unauthorized" attempts to gain access to their computer networks, which hold confidential information, in an unprecedented cyber attack that reportedly traces back to China.

The siege on both the Finance Department and the Treasury Board began more than a month ago, according to CBC News, and has threatened emails belonging to top officials.

The attacks have shut down the computer networks in both departments while counter-espionage specialists probe how much information was taken and whether it was distributed.