Canada and Brazil are in a diplomatic stand-off over accusations by Brazilian President Dilma Rousseff that Ottawa attempted to steal state secrets in 2012 from Brazil's mining and energy ministry.

Ms Rousseff said in a tweet, "The espionage infringes on the sovereignty of nations and the privacy of individuals and enterprises ... It is unacceptable among countries that claim to be partners. We reject the cyberwar."

Following the accusation, Brazilian Foreign Minister Luiz Alberto Figueredo summoned on Monday Canadian Ambassador Jamal Khokhar to explain the actions of Canada's Communications Security Establishment Canada.

However, Canada could not afford to ignore Brazil's accusation since at least 40 Canadian mining firms are in Brazil and control billions of dollars in assets.

Details of the spying were broadcast on Sunday night on Brazil's Globo network, providing details of phone calls and emails from the ministry. It was based on documents leaked by former National Security Agency contractor Edward Snowden.

Classified presentation slides presented by Mr Snowden in June described the operation called Olympia that involved the capabilities of CSEC in slides involving communications among Brazil, Peru, Ecuador, Venezuela, Britain, Poland and Singapore.

On reports of Brazil's accusation, Canadian Prime Minister Stephen Harper, who is attending the APEC Conference in Bali, Indonesia, said he is very concerned about the report and Canadian officials are reaching out very proactively to their Brazilian counterparts.

Ray Boisvert, director general of counter terrorism of the Canadian Security Intelligence Service, said, quoted by the National Post, "Like any crime drama, you look for capability and intent. Could CSEC do Brazil? Of course, it has significant capability to collect intelligence in the national interest. But on motive, you come up way short. If it was Iran, nobody would be surprised. But this is Brazil. I'm really short on motive."