Hackers have hit back in retaliation for US cyber-spying on Brazil but mistook the US space agency NASA for the National Security Agency (NSA), a news website reported here Tuesday.

"Some activists decided to protest this US practice but it seems that they picked the wrong target," a specialized blog of the Brazilian news portal Uol said.

"They hacked NASA's web page and left the message: Stop spying on us," it said.

The hackers' message also called on the United States not to attack Syria.

A NASA spokesman confirmed that a Brazilian hacker group last week posted a political message on a number of NASA websites.

"At no point were any of the agency's primary websites, missions or classified systems compromised," said NASA spokesman Allard Beutel.

"We are diligently taking action to investigate and reconstitute the websites impacted during web defacement incident," he said.

The attack followed recent disclosures that the NSA spied on Brazilian President Dilma Rousseff's email communications and on the state-run energy giant Petrobras.

The disclosures were based on documents obtained by former US intelligence contractor Edward Snowden.

Brasilia slammed the alleged spying as "unacceptable" and demanded explanations from Washington.

Rousseff postponed a state visit to Washington in protest over allegations of US cyberspying on her country.

Rousseff announced the decision after discussing the espionage row with US President Barack Obama Monday in a telephone call.