Naeem said the five prisoners freed for the hostages were "not very important Taliban commanders, but they are related to the abductors of the German engineers".
 
Mullah Baheer, a Taliban commander involved in the capture of the men, confirmed their release, saying: "The job is done. We handed the hostages to tribal elders and they handed to us our five prisoners."
 
Blechschmidt, who is said to have heart problems, told Der Spiegel's news web site he was fine after being released.
 
"I am doing well, I'm just very tired... I am happy to finally  be free after such a long time," he said.
 
Video appeal
 
Frank-Walter Steinmeier, Germany's foreign minister, said the German ambassador in Afghanistan had spoken to Blechschmidt by telephone.
 
"The German citizen ... who was kidnapped in Afghanistan is once again free. We are happy and relieved," Steinmeier said in a statement.
 
The release of the five men comes two days after Blechschmidt appeared on a video tape and appealed to the Afghan and German governments to reach an agreement with the Taliban.
 
Blechschmidt said in his video message that the German embassy had not engaged in talks for a time, but that negotiations had restarted recently.
 
The Taliban originally demanded Germany to withdraw its 3,000 troops from Afghanistan, which Berlin refused to accept.