After the Snowden disclosures, Mr. Obama ordered a complete review of spying on allies and partners. In an interview last week, the new director of the N.S.A., Adm. Michael S. Rogers, said that review had resulted in the termination of a number of spying operations, not because they were illegal, but because they were unwise.

But in conversations with German officials over the past year, the Obama administration has made it clear that its commitment extends only to Ms. Merkel herself, and not other German officials. That was one of many sources of tension as the two countries, which traditionally share intelligence on terrorism suspects and nuclear proliferation, struggled and failed to reach a new accord.

The German Parliament is conducting an inquiry into the N.S.A.’s activities in the country, and it heard its first testimony on Thursday from two Americans who formerly worked for the agency. That testimony came hours after a 27-year-old student in Bavaria was identified by name as one of the spy agency’s surveillance targets, the first German other than Ms. Merkel to be named in that way.

The testimony on Thursday lasted late into the evening, delayed in part by an extraordinary meeting between the inquiry panel and the control commission that oversees Germany’s intelligence services. The lawmakers were said to have been informed of the arrest of the accused spy at that meeting; attendees at such sessions are sworn to secrecy.

Part of the Thursday hearing was conducted in closed session after one of the American witnesses, William E. Binney, a former N.S.A. employee, said he would be discussing important secret information.

There was no immediate confirmation from the German government or the prosecutor’s office concerning the reports that the arrested man had been spying for the United States. A statement from the general prosecutor said he was detained on Wednesday by officers from the federal criminal office, the most senior police authority in Germany. It did not give details about his occupation.

On Thursday, the suspect appeared before a federal court in Karlsruhe, where the federal prosecutor’s office is located, and was ordered held “on urgent suspicion” of unauthorized intelligence activities, the prosecutor’s office said in a statement.