BERLIN — About 18 months ago, Chancellor Angela Merkel was the wronged American ally whose cellphone number was among data sucked up by American intelligence as it kept watch on Europeans.

“Spying among friends — that is simply not done,” she said after the discovery in autumn 2013, to a sympathetic domestic audience.

Within the past two weeks, the tide has turned. Ms. Merkel is back in the spotlight over spying. This time it is Germany’s foreign intelligence service, known here as the B.N.D., that is being accused of monitoring European companies and perhaps individuals. Further, the reports said the spying was done at the behest of the National Security Agency, the United States intelligence organization.

Critics have seized on the spying allegations, sensing a whiff of hypocrisy emanating from Berlin, given the German outrage over the American program. On Tuesday, Austria was the offended party, filing a legal complaint against the German and American intelligence agencies over suspicions that it was being spied on, Reuters reported.