Germany has about five soldiers taking part in the training mission alongside 15 from other EU countries. The decision to end Germany's participation in the programme, which began in 2010, was first reported by Der Spiegel magazine.
"The development of a Somali national army is moving forward only very slowly, in part due to deficits in political and institutional structures, as well as equipment gaps among trained Somali soldiers," the ministry official said.
Berlin is now looking at how to bolster its engagement in civilian security in Somalia and supports a shift recommended by an EU strategic assessment to focus more on providing advisory help, a concept currently being discussed in Brussels.
The United States last year decided to suspend food and fuel aid for most of Somalia's armed forces over corruption concerns.