Eight more soldiers were wounded, four of them seriously, in the battle in the dangerous district of Chahar Dara, south-west of Kunduz city, a spokesman at the Bundeswehr's Military Command Centre confirmed.
The firefight against Taliban insurgents was still raging late Friday afternoon German time, with NATO fighters patrolling the air above Kunduz, lending support to the troops still locked in battle on the ground.
The soldiers also suffered a roadside bomb attack.
The German soldiers were attacked from several directions during a patrol, news magazine Der Spiegel reported, citing Afghan police. News agency DPA reported that they were conducting a mine sweep when they were attacked by several dozen Afghan fighters.
An armoured military car sent in to rescue the soldiers trapped in the firefight was hit by a bomb placed on or next to the road, injuring several more soldiers, the according to various media reports.
The wounded soldiers were taken by helicopter to the military camp in Kunduz.
Defence Minister Karl-Theodor zu Guttenberg reacted with shock to the news.
''I have today with great sadness learned of the dead and injured German soldiers in Afghanistan,'' he said in a statement. ''My thoughts and prayers go to the families. In the face of combat on such a scale, it is clear how dangerous the nonetheless necessary mission in Afghanistan is.''
This was the first deadly fight for German soldiers this year. It brought to 39 the number of German soldiers killed in Afghanistan.