Mr. Nasir said that since losing his engineering job about five years ago, he had been trading semiprecious stones, which has taken takes him around Europe and to the tribal areas of Pakistan, where he said he looked for bargains.

The German authorities see his trips there differently. An Aug. 1, German court order authorizing a police search, citing information from the Pakistani Inter-Services Intelligence agency, or ISI, said there was sufficient evidence that he supported Al Qaeda “by the financial payments, by the recruitment of fighters, by the handing over of field glasses and night-vision glasses, as well as by the idea of fighting for Al Qaeda by himself.”

Mr. Nasir was detained as he prepared to fly home from Lahore, Pakistan, on June 18, after having spent 10 days in the tribal areas. “We know you were there,” Mr. Nasir said he was told the first day by a Pakistani intelligence officer. “We know everything about you.”

The agents even knew he had brought a pair of $180 night-vision goggles into the country. He said he had an explanation: he brought them for a friend in the tribal area of North Waziristan who has many sheep, goats and cows. “He was having with him a very bad instrument, you know, to watch the animals and so I said, ‘If you want, I can bring you some better,’ ” Mr. Nasir said.

Then Western intelligence agents, who he said he believes were American and British, took over the questioning, he said, and pressed him to divulge all that he knew about militant plots. “ ‘Are you planning any attacks in the United States?’ ” he said they asked. “ ‘Are you familiar with American military installations in Japan and South Korea? How were you going to use the bomb-making chemicals that were found in your house?’ ” He said he used the chemicals to clean gems.

In daily sessions lasting as long as seven hours, he said, Western officials questioned him, while a Pakistani interrogator sat off to the side, sometimes sleeping. “The Americans are very intelligent,” he said. “They let you speak, and don’t tell you anything. Only the Pakistanis were crude, saying things like, ‘Do you make bombs?’ ”

Some of the questions were focused on his travels to Pakistan’s tribal areas, particularly South Waziristan and North Waziristan, he said, and they asked about a man named Sheik Said, whom they identified as the No. 3 leader in the training camps, and about whether he visited the compound run by a man named Abu Ubayda al-Missri, who has been identified as a camp leader. They asked how he communicated with his family in Germany. “They said there are Internet cafes, and asked why I didn’t send e-mails from them,” he said.