Germany's parliament has voted to increase its troop level in Afghanistan by 850 and extend its mission in the country by one year.
The government plans to send 500 troops to the war-torn country, with the remaining 350 on standby and tasked with training up Afghan security forces.
The increase, which will see Germany's mandate for the country raised to 5,350 soldiers, was less than Nato had pushed for, reflecting strong public opposition to further deployment.
During Friday's vote in Germany's lower house the Left Party raised its opposition to the bill by holding up placards with the names of people killed in a Nato bombing ordered by a German officer in September.
"Germany is involved in a war against the ordinary population in Afghanistan," Christine Buchholz, a Left Party politician said during the debate.
"However you justify the war, you are deciding today about life or death."
'Victory for sense'
But despite growing public disillusionment over the conflict, some 429 of 622 lawmakers backed the troop increase, with 111 voting against.
Guido Westerwelle, Germany's foreign minister, said the vote was a "victory for sense and responsibility".
"Our Afghanistan policy could not carry on as it had before, everyone knows that. But at the same time, we could not rashly leave and look away."
German troops currently form the third-largest contingent in the 110,000-strong international force behind the United States and Britain.
The new head of the German army said earlier February that Afghanistan could be as much as two decades away from being a functioning state.
The vote came as Taliban suicide bombers hit private guesthouses in the centre of Kabul, killing 16 people including foreigners in one of the deadliest attacks on the Afghan capital in a year.