Top secret documents retrieved by U.S. whistleblower Edward Snowden show that Prime Minister Stephen Harper's government allowed the largest American spy agency to conduct widespread surveillance in Canada during the 2010 G8 and G20 summits.

U.S. government response A state department official said the United States "recognizes the importance of privacy to its citizens and people around the world." "The President has directed a review that looks across the board at our intelligence gathering to ensure that we are properly accounting for both the security of our citizens and our allies, and the privacy concerns shared by Americans and citizens around the world. "This review is being led by the White House, and includes agencies from across the government. There are also important efforts underway that will enable others to review how we strike the right balance, including the Review Group on Intelligence and Communications Technology and the Privacy and Civil Liberties Oversight Board. "While we are not going to comment publicly on every specific alleged intelligence activity, as a matter of policy we have made clear that the United States gathers foreign intelligence of the type gathered by all nations."

The documents are being reported exclusively by CBC News.

The briefing notes, stamped "Top Secret," show the U.S. turned its Ottawa embassy into a security command post during a six-day spying operation by the National Security Agency while U.S. President Barack Obama and 25 other foreign heads of government were on Canadian soil in June of 2010.

The covert U.S. operation was no secret to Canadian authorities.

An NSA briefing note describes the American agency's operational plans at the Toronto summit meeting and notes they were "closely co-ordinated with the Canadian partner."

The NSA and its Canadian "partner," the Communications Security Establishment Canada, gather foreign intelligence for their respective governments by covertly intercepting phone calls and hacking into computer systems around the world.

The secret documents do not reveal the precise targets of so much espionage by the NSA — and possibly its Canadian partner — during the Toronto summit.

But both the U.S. and Canadian intelligence agencies have been implicated with their British counterpart in hacking the phone calls and emails of foreign politicians and diplomats attending the G20 summit in London in 2009 — a scant few months before the Toronto gathering of the same world leaders.

Notably, the secret NSA briefing document describes part of the U.S. eavesdropping agency's mandate at the Toronto summit as "providing support to policymakers."

Documents previously released by Snowden, a former NSA contractor who has sought and received asylum in Russia, suggested that support at other international gatherings included spying on the foreign delegations to get an unfair advantage in any negotiations or policy debates at the summit.

It was those documents that first exposed the spying on world leaders at the London summit.

More recently, Snowden's trove of classified information revealed Canada's eavesdropping agency had hacked into phones and computers in the Brazilian government's department of mines, a story that touched off a political firestorm both in that country and in Ottawa.

The documents have rocked political capitals around the world. NSA spies on everyone from leaders of U.S. allies to millions of Americans. Personal information has been scooped up by the agency's penetration of major internet and phone companies.

Economic and political espionage

The spying at the Toronto summit in 2010 fits a pattern of economic and political espionage by the powerful U.S. intelligence agency and its partners such as Canada.

That espionage was conducted to secure meeting sites and protect leaders against terrorist threats posed by al-Qaeda but also to forward the policy goals of the United States and Canada.

The G20 summit in Toronto had a lot on its agenda that would have been of acute interest to the NSA and Canada.

Secret documents released by U.S. whistleblower Edward Snowden have provided new insight about the level of U.S. and Canadian spying on allies and foreign diplomats. (The Guardian/Associated Press)

The world was still struggling to climb out of the great recession of 2008. Leaders were debating a wide array of possible measures including a global tax on banks, an idea strongly opposed by both the U.S. and Canadian governments. That notion was eventually scotched.

The secret NSA documents list all the main agenda items for the G20 in Toronto — international development, banking reform, countering trade protectionism, and so on — with the U.S. snooping agency promising to support "U.S. policy goals."

Whatever the intelligence goals of the NSA during the Toronto summit, international security experts question whether the NSA spying operation at the G20 in Toronto was even legal.

"If CSEC tasked NSA to conduct spying activities on Canadians within Canada that CSEC itself was not authorized to take, then I am comfortable saying that would be an unlawful undertaking by CSEC," says Craig Forcese, an expert in national security at University of Ottawa's faculty of law.

By law, CSEC cannot target anyone in Canada without a warrant, including world leaders and foreign diplomats at a G20 summit.

But, the Canadian eavesdropping agency is also prohibited by international agreement from getting the NSA to do the spying or anything that would be illegal for CSEC.

Canada's 'Five Eyes' partners

The NSA isn't Canada's only partner in the covert surveillance business.

They are part of a multinational partnership that includes sister organizations in the U.K., Australia and New Zealand — the so-called "Five Eyes."

CSEC has roughly 2,000 employees and an annual budget of about $450 million. It will soon move into a new Ottawa headquarters costing taxpayers more than $1.2 billion, the most expensive federal government building ever constructed.

By comparison, the NSA is the largest intelligence agency in the U.S., with a budget of over $40 billion and employing about 40,000 people. It is currently building what is believed to be one of the largest and most powerful computers in the world.

CSEC is comparatively much smaller but has become a formidable and sophisticated surveillance outlet. Canadian eavesdroppers are also integral to the Five Eyes partnership around the world.

The documents obtained by the CBC do not indicate what, if any, role CSEC played in spying at the G20 in Toronto.

A protester jumps on a burnt-out car as a police car burns in the background during an anti-G20 demonstration June 26, 2010 in Toronto. Top secret NSA briefing notes predicted vandalism by "issue-based extremists" was a more likely threat than al-Qaeda-type terrorists during the event. (Ryan Remiorz/Canadian Press)

Much of the secret G20 document is devoted to security details at the summit, although it notes: "The intelligence community assesses there is no specific, credible information that al-Qa'ida or other Islamic extremists are targeting" the event.

No matter. The NSA warns the more likely security threat would come from "issue-based extremists" conducting acts of vandalism.

They got that right.

Protest marches by about 10,000 turned the Toronto G20 into an historic melee of arrests by more than 20,000 police in what would become one of the largest and most expensive security operations in Canadian history.

By the time the tear gas had cleared and the investigations were complete, law enforcement agencies stood accused of mass-violations of civil rights.

Add to that dubious legacy illegal spying by an American intelligence agency with the blessing of the Canadian government.

CBC contacted the Canadian and U.S. governments for comment, and answers to specific questions.

U.S. State Department officials would not comment directly on the spying issue. Instead they pointed to the fact President Obama has ordered a review of all NSA operations in the wake of the Snowden revelations.

In Canada, officials at CSEC offered no comment .