The patrol was northwest of Kunduz when it came under fire from automatic weapons and anti-tank guns. The soldiers returned fire and broke through the ambush, the military reported.
Members of the Quick Reaction Forces from the German Bundeswehr were also attacked, but all soldiers and vehicles came away unharmed.
Losses on the side of the insurgents are unknown.
According to media reports, the Taliban is reportedly planning to step up its military campaign to exploit political sensitivities in the run-up to Germany’s general election.
German soldiers recently captured a Taliban leader Abdul Razeq after a raid which some say signals a change in attitude from what has been called by other countries a timid approach.
German Bundeswehr soldiers are part of the NATO-led International Security Assistance Force (ISAF) in the relatively peaceful north of Afghanistan. Parliament voted last year to increase their numbers from 3,500 to 4,500 this August.
A total of 32 German soldiers have died in Afghanistan since their deployment in 2002.