Defence Minister Annegret Kramp-Karrenbauer tweeted that the last Bundeswehr soldiers "left Afghanistan safely” on Tuesday evening, ending a nearly 20-year deployment there alongside US and other international forces.
An independent report published last week in redacted form said there was evidence that 39 unarmed Afghan prisoners and civilians were killed by 19 Australian soldiers.
Al Shabaab has battled since 2008 to overthrow Somalia's internationally-recognised central government and establish its rule, based on its own interpretation of Islamic law.
Takhar provincial health director Abdul Qayoum confirmed the incident but said 34 security personnel had been killed — including the deputy police chief of the province.
The shameful record included alleged instances in which new patrol members would shoot a prisoner in order to achieve their first kill in a practice known as "blooding,” said Australian Defence Force Chief Gen. Angus Campbell.