RIO DE JANEIRO — Brazil’s government acknowledged on Monday that its top intelligence agency had spied on diplomatic targets from countries including the United States, Iran and Russia, putting the Brazilian authorities in the uncomfortable position of defending their own surveillance practices after repeatedly criticizing American spying operations.

Brazil’s Institutional Security Cabinet, which oversees the nation’s intelligence activities, contended in a statement on Monday that the spying operations, involving relatively basic surveillance about a decade ago of diplomats and diplomatic properties in Brazil, were “in absolute compliance” with legislation governing such practices.

The statement followed a report in the newspaper Folha de São Paulo describing how the Brazilian Intelligence Agency, commonly known as Abin, had followed some diplomats from Russia and Iran on foot and by car, photographing their movements, while also monitoring a commercial property leased by the United States Embassy in Brasília, the capital.

By almost any measure, such modest operations stand in sharp contrast to the sweeping international eavesdropping operations carried out by the National Security Agency. Brazil’s president, Dilma Rousseff, recently postponed a state visit to Washington after revelations that the N.S.A. had spied on her and the Brazilian oil giant, Petrobras.