President Barack Obama vowed Friday to work with Brazil and Mexico to ease tensions over allegations that the US National Security Agency spied on the leaders of Latin America's powerhouses.

Obama told Brazilian President Dilma Rousseff and Mexican President Enrique Pena Nieto in separate meetings at the G20 summit that he understood their reaction to reports that the NSA had snooped on their online activities.

"What I assured President Rousseff and President Pena Nieto is that I take these allegations very seriously, I understand their concerns, the concerns of the Mexican and Brazilian people. We will work with their teams to resolve what is the source of tensions," he said.

Rousseff told reporters she had expressed her "personal indignation" over the claims and that the US leader pledged to provide answers by Wednesday.

The Brazilian leader, who is scheduled to visit Washington on October 23, warned that "if the conditions are not met, I'm obviously not going."

Rousseff had been all smiles earlier as Obama took his place next to her during a group photograph session at the summit in Saint Petersburg, even reciprocating when he leaned over to kiss her on the cheek.

For his part, Pena Nieto said the US leader assured him that he did not order a spying operation against him.

Obama, he said, gave his "personal commitment and desire to launch an investigation, and if actions took place outside the law, find who is responsible and impose corresponding sanctions".

The US president sought to downplay the impact of the spying claims on relations with Latin America's top two economies, saying tensions on the issue did not mean it overrides their wide-ranging common interests.

Outrage followed Sunday's report by US journalist Glenn Greenwald, who has access to documents leaked by fugitive former NSA contractor Edward Snowden, that the agency accessed communications of Rousseff and Pena Nieto.

On Thursday, Brazil halted preparations for Rousseff's October trip to the United States -- which would be her first to Washington and the first state visit by a foreign leader this year.

With all three leaders in Russia for the G20 summit, Obama went into damage control mode, and held separate bilateral talks with Latin American leaders on Thursday.

"Just because there are tensions doesn't mean it overrides all the incredibly wide-ranging interests that we share with so many of these countries," he said.

"We will work through this particular issue, it doesn't detract from larger concerns we have and the opportunities that we both want to take advantage of," he added.

Greenwald, who is based in Rio de Janeiro, reported Sunday that the NSA was using a programme to access all Internet content Rousseff visited online.

He told Globo television that the NSA was trying to better understand Rousseff's methods of communication and interlocutors.

The NSA programme allegedly allowed agents to access the entire communications network of the president and her staff, including telephone, Internet and social network exchanges, the Rio-based journalist said.

He also said some of Pena Nieto's email, phone calls and text messages were intercepted, including communications in which he discussed potential cabinet members before he was elected in July 2012.

On Monday, Brazil and Mexico summoned the US ambassadors in their respective countries to demand an explanation for the latest disclosures.

Brazilian Foreign Minister Luis Figueiredo said that, if proven, the report that Rousseff was spied on "represents an unacceptable and impermissible violation of Brazilian sovereignty."

Communications Minister Paulo Bernardo said the scope of the espionage was broader and more serious than initially thought and that US explanations have so far been "false."