RIO DE JANEIRO (Reuters) - Brazil's telecommunications agency said on Monday it would investigate whether local operators had violated customer privacy rules in alleged surveillance of Brazilian telecommunications data by U.S. spy agencies.

The decision came as U.S. officials, including the American ambassador in Brasilia, sought to reassure Brazil following reports in the O Globo newspaper that the American Central Intelligence Agency and National Security Agency had gathered telephone and email data in Brazil and used Brazil-based equipment to do so.

The stories, on Sunday and Monday, were based on reporting from documents provided by Edward Snowden, the fugitive former American intelligence contractor, to Glenn Greenwald, the journalist who first broke the story of surveillance by the American government of telecommunications data in the U.S.

Greenwald, an American citizen who lives in Rio de Janeiro, said on Sunday in a Twitter message that he had worked with O Globo on the reports to more quickly relay the scope and reach of the alleged surveillance. The bulk of Greenwald's stories thus far have appeared in the British newspaper, the Guardian.

Following the reports in O Globo, Brazil's government said it would press the United States for an "explanation."

"We don't agree with interference of that type, not just in Brazil, but in any other country," President Dilma Rousseff told reporters on Monday.

Brazil's communications minister Paulo Bernardo said that Thomas Shannon, the U.S. ambassador in Brazil, told him in a meeting that the United States had not spied on Brazilian citizens or violated their privacy by gathering data on them from the Internet.

At a news conference, Bernardo said the ambassador acknowledged that the U.S. government does monitor metadata from telephone calls, "but not in Brazil."

Shannon denied that Brazilian telecoms firms had cooperated in violating the privacy of Brazilians, the minister said. A U.S. embassy spokesman confirmed the meeting with Bernardo, adding that Shannon afterwards said the O Globo reports were "an erroneous characterization of our intelligence programs."

U.S. AMBASSADOR INVITED TO TESTIFY

Meanwhile, the Brazilian Senate's foreign relations committee said it would invite Shannon to testify at a special hearing this week. Greenwald will also be invited to testify, in addition to Brazilian security, intelligence and foreign affairs officials.

"We need to examine carefully the documents published this weekend," Senator Ricardo Ferraço, the committee chair, said in a Twitter message. It is unclear whether Shannon, who is not obliged to testify, will do so.

Anatel, Brazil's telecommunications regulator, for its part said Monday it would work with the country's federal police to determine whether local telephone operators had broken any laws. The agency did not say what companies would be probed or whether any specific operators were already under suspicion.

According to the O Globo stories, access to Brazilian communications was obtained through American companies that were partners with Brazilian telecommunications companies. The reports did not identify any of the companies.

Brazil's biggest telecommunications companies include TIM Participacoes, the Brazilian unit of Telecom Italia, Grupo Oi, Telefonica Brasil, and Claro, a unit of Mexican tycoon Carlos Slim's America Movil.

(Reporting by Leonardo Goy and Anthony Boadle in Brasilia. Writing by Paulo Prada; Editing by Philip Barbara)