Niger soldiers patrol in the desert of Iferouane on February 12, 2020. AFP
Jorg Lange, 63, "can return to his family", said Bianca Kaltschmitt, director general of the NGO Help, thanking Germany's foreign ministry, criminal police and the authorities in Mali, Niger, and other neighboring countries for contributing to his release.
Lange was kidnapped by armed men riding motorcycles on April 11, 2018, near Ayorou in western Niger, in a region near the Malian border frequently hit by jihadist attacks.
His Nigerien driver was freed shortly afterward, but according to German media, Lange was sold to the Islamic State in the Greater Sahara group.
German weekly Der Spiegel quoted security sources saying Lange was "in good health, given the circumstances".
According to the magazine, the Moroccan secret services' contacts with jihadist groups in the Sahel facilitated Lange's liberation.
Der Spiegel said the humanitarian worker was repatriated on a German army plane.
German media has reported that the kidnappers sought a seven-figure ransom sum and urged Berlin not to try to drag out negotiations.
The government considered deploying KSK special forces to free Lange, but decided the operation would be too risky, Der Spiegel said.
The German government declined to respond to an AFP request for comment on Lange's release.
At least four Western hostages from France, the United States, Australia and Romania are still detained in the Sahel, according to a tally only covering cases made public by their entourage or governments.
Another German, Catholic priest Hans-Joachim Lohre, has been missing since late November and is widely thought to have been kidnapped, although no one has claimed responsibility.
The Sahel conflict began in northern Mali in 2012, spread to Burkina Faso and Niger in 2015 and now Gulf of Guinea states are suffering sporadic attacks from Islamist militants.
Across the three Sahel nations, thousands of people have been killed, more than two million displaced and devastating damage has been inflicted on three of the poorest economies in the world.