Confirming a report by weekly news magazine Der Spiegel, the spokesman said "the government is in contact with the Americans to clarify this affair and is trying to free" the man. German Foreign Minister Frank Walter Steinmeier has spoken with his US counterpart Condoleezza Rice to discuss the case.
Der Spiegel said Rice told Steinmeier during a meeting early last month that she would look into the affair.
The magazine said the man, who was only identified as 41-year-old Gholam Ghaus Z., travelled to the Afghan capital to visit his family. He was arrested when he wanted to buy a razor at an American army supermarket and suspected to be a terrorist because he carried various currencies and telephone cards with him.
"Several hours of questioning could not confirm the suspicion," according to the magazine.
The man was questioned by agents of German intelligence agency BND at the US prison at Bagram in Afghanistan and domestic German intelligence also opened an investigation into his life in Germany.
"Everything was okay," a senior expert told Der Spiegel.
German diplomats and intelligence experts likened the case to that of Murat Kurnaz, a German-born Turk who was detained at a US prison in Guantanamo between 2002 and 2006 before being finally cleared.