Spain says the U.S. ambassador has given his assurances that the U.S. National Security Agency's activities in the country are carried out in conjunction with Spain's intelligence agency and in accordance with Spanish law.

In a statement, the Foreign Ministry said U.S. Ambassador James Costos told Foreign Minister Jose Manuel Garcia-Margallo on Friday that NSA spying in Spain is always done for security reasons like combatting terrorism. It said Costos said the spying was never for economic reasons.

It was not clear if Costos was referring to NSA activities now or in the past. The U.S. embassy confirmed Friday's meeting but had no further comment.

Costos was summoned following reports the NSA had spied on politicians in Spain and other countries and on the communications of ordinary European citizens.