BERLIN — German-U.S. relations are facing a new test over a German intelligence employee who reportedly spied for the U.S., with Germany's president saying if the allegations are true, that kind of spying on allies must stop.

Prosecutors say a 31-year-old German was arrested last week on suspicion of spying for foreign intelligence services, and that he allegedly handed over 218 documents between 2012 and 2014. German media, without naming sources, have reported he was an employee of Germany's foreign intelligence service who says he sold his services to the U.S.