The UN General Assembly has adopted a resolution aimed at protecting the right to privacy of internet users.
The resolution was introduced by Brazil and Germany after allegations that the US had been eavesdropping on foreign leaders, including Brazil’s Dilma Rousseff and Germany’s Angela Merkel.
The claims stem from leaks by US intelligence fugitive Edward Snowden.
General Assembly resolutions are non-binding but they can carry significant moral and political weight.
The resolution calls for all countries to guarantee privacy rights to users of the internet and other forms of electronic communications.
It affirms “that the same rights that people have offline must also be protected online".
It also expresses concern at the harm that such scrutiny, including spying in foreign states and the mass collection of personal data, may have on human rights.
Though it does not mention any specific country, Brazil and Germany have been angered by details of US snooping leaked to media organisations by former National Security Agency (NSA) contractor Edward Snowden.
One of the leaks claimed that the NSA had been bugging Mrs Merkel’s mobile phone for years.
Ms Rousseff also was angered by revelations that the NSA had hacked the computer network of Brazil’s state-run oil company Petrobras to collect data on emails and telephone calls.
US Secretary of State John Kerry has acknowledged that in some cases US spying had gone too far.
And a White House panel has recommended significant curbs on the NSA’s electronic surveillance programmes.
Mr Snowden, 30, fled to Russia in June after leaking details of far-reaching US telephone and internet espionage. He has temporary asylum, allowing him to live in Russia, until July 2014.